eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'JavaScriptCompletionEngine':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: JavaScriptCompletionEngine


Inheritance:

   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

Instance protocol:

accessing
o  klass

completion
o  completeForMethod: methodOrNil class: classOrNil context: contextOrNil codeView: codeViewArg into: actionBlock
Transcript showCR: (codeView textFromCharacterPosition:n startPosition to:n endPosition) asString string.

o  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
o  completeGlobalVariables
First, globals starting with typed prefix

o  completeLocalVariables
Make those starting with typed prefix first in the list.

o  completeMessage
Now, have to translate selectors from Smalltalk to JavaScript form

o  completeVariable

private-helpers
o  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)

o  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.

o  selectorToFunctionName: selector
self error: 'Invalid JavaScript function/method name'.



ST/X 7.2.0.0; WebServer 1.670 at bd0aa1f87cdd.unknown:8081; Sat, 20 Apr 2024 04:25:33 GMT