-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support getCompletions in external module name references in imports and exports #2173
Conversation
return false; | ||
} | ||
|
||
function getExternalModulecompletions(location: Node): CompletionInfo { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalize the 'c'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave a comment about what kinds of completions we support, then leave a small example. For instance, we don't hit the disk to look up available files (and note this in the comment), so be explicit, since I find that modules are the most arcane part of the compiler and language.
You may want someone who knows more about the internals of modules to take a look. Otherwise, just update the API samples. |
@@ -2483,6 +2485,11 @@ module ts { | |||
log("getCompletionsAtPosition: Get previous token 2: " + (new Date().getTime() - start)); | |||
} | |||
|
|||
// Check of this is an external module name completion location |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Check if"
closing for now. |
Curious why this was closed? |
The problem is that the current API makes it the caller's responsibility to find the replacement span for a completion item, e.g. "a.fo|" with completion item "foo" would result in replacing the "fo"; this is ok if all the replacements are identifiers. in this case if you are replacing a string applying the same logic does not work. so i need to add a replacement range to the API. i will reactivate it once i am done with a few other items related to modules and decorators. but should be able to get back to it within the next few weeks. |
Cool. I was just curious if there were dragons in the code path. The code seems fit for my purpose. I replace the entire import string on users behalf ;) |
there is still some work that needs to be done on the editor side, but this should cover the service side.