-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lsp: Use pygls
Documents
for get_initial_doctree
The check for whether we should parse a document in `get_initial_doctree` now relies on `get_location_type` rather than checking the file extension. This means that files that don't have the traditional `*.rst` extension but are treated by the client as reStructuredText documents should now work as expected. Additionally, by reading the document's source from the `Document` maintained by `pygls` rather than reading from disk, document symbol requests are more accurate taking into account any unsaved changes in the user's editor. This also removes the need for direct file system access - poentially opening the door for running the vanilla docutils server in Pyodide?!
- Loading branch information
Showing
4 changed files
with
23 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Document symbol requests made for unsaved files now use the language client's version rather than the version on disk. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
The server should now handle document symbol requests for files that are treated as reStructuredText files by a language client but don't have an ``*.rst`` extension. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters