Open asg017 opened 3 years ago
Hm, this sounds like a job for the custom Language Server (with an additional complication that it would have to fetch actual values from the browser window) -- but at least it should cover multiple editors simultaneously? the list of tools with LSP support is steadily growing
@wizzard0 that sounds right! I haven't played much with vscode language servers, but from what I've used before it sounds do-able. There would need to be some sort of "connection" between a selected client and your code editor of choice, where the client shared data on what cells are active/what keys can be accessed on those objects. I dont know of any other VS Code language server that does this sort of dynamic auto-complete option (I'd imagine most just do static analysis of your code to figure it out).
"Editor-agnostic" would be key here, idk if any other editor that has a "language server" like vscode, mostly because Ive never looked into it. Im sure that vim has some crazy extensions that can do this, or Atom
idk if any other editor that has a "language server" like vscode
The list of tools on LSP website looks quite decent! dunno about the quality of integrations in all of them though. But Rust, Go etc etc. already provide LSPs so it seems like it's on its way to becoming a de-facto standard.
https://microsoft.github.io/language-server-protocol/implementors/tools/
Say you have:
When updating the
update
cell and accessingelement
, I want to be able to use autocompletion (ie,<Tab>
) to see all th enumerable fields of theelement
cell's value. In this case, it's an HTML element, so I should see a dropdown list ofquerySelector
,querySelectorAll
,getAttribute
, etc.But I use VS Code, some people like vim, others emacs. Autocompletion in each editor would be different, but the same underlying list of enumerable fields should be the same for all potential editor clients.
d = {a: {b: {c: 7}}}
could have a autosuggested pathd.a.b.c
, may need to request valid fields from the editor client -> dev server -> index.html client on every cell (seems like fun)document
orwindow.location
should be supported as well