get document source, e.g x=new XMLSerializer().serializeToString(document)
tokenize it (bit more complex than just split(), might need e.g nlp_compromise)
de-deplicate tokens
sort aphabetically
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
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
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 )
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
... 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
for example
x=new XMLSerializer().serializeToString(document)
split()
, might need e.g nlp_compromise)optionally
<script>
tagcomplete_partial_token(partial_token)
thenexample of introspection with some filtering
from https://stackoverflow.com/questions/2051678/getting-all-variables-in-scope/2052434#2052434
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 )
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
should be done for JS first...
... but also for
dxr
and potentially any language with its notation system.see #58 principle