Or, at least they might be obvious in a particular way. So some things that might not be obvious in code, like what the syntax for a class of names is, might be obvious in theory, too. Or I'd be willing to say that maybe, like in Haskell, certain aspects of the language, are syntactic categories, like the parser. Perhaps, like in Perl, there are syntactic categories of types that make it much easier to find things like nodes in a tree, since they're the ones that come in the input. There's many things we can do to make Tree-sitter simpler to read and write. Or a grammar tree, which is a set of elements. So, a syntactic tree is a list of elements, grouped by their ordering, which are to be parsed from their arguments, as they appeared in the input. We're especially excited about tools and formats like tree-sitter and LSIF around which a large and supportive community can grow so that all the products we love and rely on as developers can all make forward progress. We've visited a few islands in this space but still very curious to see what other islands can be discovered. zero-configuration vs configuration required Every tool has its own set of unique trade-offs and fall somewhere on these spectrums: It's very interesting to see the topological space that houses these solutions fill out. That'll enable a lot of features that are out of reach for tree-sitter, but is a lot harder to get working out of the box and it's a much bigger technical investment. Sourcegraph is only used for navigating committed code, so we're leveraging formats like LSIF to generate complete semantic graphs of codebases and their entire dependency tree. It's not the exact right fit for our primary goals though, since it's designed around being extremely fast while editing and robust against errors. It's been catching our attention more and more lately, and we have plans to use it to upgrade our out-of-the-box, instant code navigation experience. Tree-sitter would definitely give better results than our current ctags-based approach. We've been busy building out true precise code intelligence/navigation support, but we also have a mode for zero-configuration code navigation based on text search, universal-ctags, and hand-rolled regular expressions (which works surprisingly well!). I'm an engineer on the code intelligence team at Sourcegraph. There's a bit of confusion about TSX vs typescript langs but it's fixable with some config change. There's syntax highlighting support and tree-walking APIs. There's a nicely documented Emacs package for this. " position, adding a new className if it doesn't exist. A command to add a CSS class to the nearest JSX node, or to walk up the tree at the className="|. A command to "add an arg to current function" which works across languages. Syntax-tree based highlighting (vs regex highlighting). I can't wait for the tools to get built with this. The parse tree emits specific ERROR nodes, so you can get a semi-functional tree even with broken syntax. It resembles an AST more than a parse tree (ie no 11 levels of binary op precedence rules in the tree). The parse tree is extremely concise and readable. The parsing is fast enough to run on every keystroke. Hit F5 to launch an Extension Development Host with the extension.įor working on the language server, the easiest way is to replace the language server installation from composer in vendor/felixfbecker/language-server with a symlink to your local clone.įor guidance on how to work on the language server, please see the language server repository.Tree Sitter is amazing. The last command will open the folder in VS Code. TodoĬlone whole repository and in root directory execute: composer install Please use a dedicated extension like PHP CS Fixer. Please use a dedicated extension like PHP CodeSniffer. Files are still indexed when opened in editor. Set setting to not index glob patterns on startup. I recommend to disable VS Code's built-in PHP IntelliSense by setting to false to avoid duplicate suggestions. Note: PHP 8.0 does work, PHP 8.1 support is work in progress. You can either add it to your PATH or set the php.executablePath setting. You need at least PHP 7.4 installed for the extension to work. You do NOT need to install it manually though, it is bundled in this extension. The language server itself is implemented purely in PHP in its own repository, all features need to be implemented there and all issues should be reported there. Note: This is just the VS Code extension that spawns the actual language server. Note: This is a fork of the original project that was de-listed from the marketplace. Advanced PHP IntelliSense for Visual Studio Code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |