|
Class: JavaScriptCompletionEngine
Object
|
+--JavaScriptCompletionEngine
- Package:
- stx:libjavascript
- Category:
- Languages-JavaScript-Compiling & Parsing
- Version:
- rev:
1.18
date: 2019/06/04 15:21:14
- user: cg
- file: JavaScriptCompletionEngine.st directory: libjavascript
- module: stx stc-classLibrary: libjavascript
accessing
-
klass
-
completion
-
completeForMethod: methodOrNil class: classOrNil context: contextOrNil codeView: codeViewArg into: actionBlock
-
Transcript showCR: (codeView textFromCharacterPosition:n startPosition to:n endPosition) asString string.
-
parseSource: source
-
the actual call to the parser; redefinable for JS-like languages
which may have more than a single method/function to parse
private-completion helpers
-
completeGlobalVariables
-
First, globals starting with typed prefix
-
completeLocalVariables
-
Make those starting with typed prefix first in the list.
-
completeMessage
-
Now, have to translate selectors from Smalltalk to JavaScript form
-
completeVariable
-
private-helpers
-
classOfNode: aNode
-
when showing possible completions for a message,
it is a good idea to know what the reveiver is.
This method tries to ficure out what class the node might have
(mostly heuristics)
-
editorToCompleteNode: node in: codeView fromSelectionIn: variables
-
private helper: return an editAction to replace
the word before the cursor by the selected variable from variables.
variables being a list of suggested completions.
-
selectorToFunctionName: selector
-
self error: 'Invalid JavaScript function/method name'.
|