completion #82

Open
opened 2 years ago by utopiah · 5 comments
Owner

for example

  1. get document source, e.g x=new XMLSerializer().serializeToString(document)
  2. tokenize it (bit more complex than just split(), might need e.g nlp_compromise)
  3. de-deplicate tokens
  4. sort aphabetically
  5. return matches

optionally

  • rank or limit by
    • frequency
    • scope e.g <script> tag
      • semantically meaningful scope, e.g current function
    • spatially, e.g limit to volume boundary, e.g .5m sphere
  • UX : test with
    • function e.g complete_partial_token(partial_token) then
    • keyboard shortcut e.g Ctrl-n then
    • gesture shortcut e.g pull end of token to right
for example 1. get document source, e.g `x=new XMLSerializer().serializeToString(document)` 1. tokenize it (bit more complex than just `split()`, might need e.g nlp_compromise) 1. de-deplicate tokens 1. sort aphabetically 1. return matches optionally * rank or limit by * frequency * scope e.g `<script>` tag * semantically meaningful scope, e.g current function * spatially, e.g limit to volume boundary, e.g .5m sphere * UX : test with * function e.g `complete_partial_token(partial_token)` then * keyboard shortcut e.g Ctrl-n then * gesture shortcut e.g pull end of token to right
Poster
Owner

example of introspection with some filtering

for ( var i in window ) {
    if (typeof window[i] == "function" && i.length>2) console.log(i, typeof window[i], window[i]);
}

from https://stackoverflow.com/questions/2051678/getting-all-variables-in-scope/2052434#2052434

example of introspection with some filtering ```javascript for ( var i in window ) { if (typeof window[i] == "function" && i.length>2) console.log(i, typeof window[i], window[i]); } ``` from https://stackoverflow.com/questions/2051678/getting-all-variables-in-scope/2052434#2052434
Poster
Owner
could also rely on https://esprima.org for AST or even completion https://github.com/espadrine/aulx especially https://github.com/espadrine/aulx/blob/master/js/sandbox.js (related discussion https://twitter.com/utopiah/status/1625053344736636929 )
Poster
Owner

see also https://github.com/JunoLab/FuzzyCompletions.jl relying on levenshtein distance to be more flexible and the idea of expanding it including via hooks https://github.com/JuliaLang/julia/issues/44287

see also https://github.com/JunoLab/FuzzyCompletions.jl relying on levenshtein distance to be more flexible and the idea of expanding it including via hooks https://github.com/JuliaLang/julia/issues/44287
Poster
Owner

should be done for JS first...

should be done for JS first...
utopiah closed this issue 2 years ago
utopiah reopened this issue 2 years ago
Poster
Owner

... but also for dxr and potentially any language with its notation system.

see #58 principle

... but also for `dxr` and potentially any language with its notation system. see https://git.benetou.fr/utopiah/text-code-xr-engine/issues/58 principle
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: utopiah/text-code-xr-engine#82
Loading…
There is no content yet.