Skip to content

Conversation

@wolmir
Copy link
Contributor

@wolmir wolmir commented Sep 22, 2022

The standard documents manager provided by the VSCode SDK is only aware of text documents that the user has already opened in the editor area.

This is annoying because we would expect a feature like Go to Definitions to be immediately aware of the params.yaml file for example.

To solve this problem this PR will create a custom request from the Client to the Server with an initial batch of interesting documents. For now they are any yaml or json files that are not inside a hidden folder.

@wolmir wolmir marked this pull request as ready for review September 22, 2022 18:44
async start() {
await this.client.start()

const files = await findFiles('**/*.{yaml,json}', '.??*')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[I] Needs Python files too.

@mattseddon mattseddon added the product PR that affects product label Sep 23, 2022
@mattseddon
Copy link
Contributor

mattseddon commented Sep 23, 2022

Suggestion: When we cannot open a file, i.e the symbol is a folder we could use @command:revealInExplorer to show the folder in the explorer tree.

Some example usage invscode:

https://github.com/microsoft/vscode/blob/6d62e3b80b950cd38294bf09083c93334aa5ec15/extensions/git/src/commands.ts#L2868

https://github.com/microsoft/vscode/blob/6d62e3b80b950cd38294bf09083c93334aa5ec15/extensions/markdown-language-features/src/util/openDocumentLink.ts#L25

https://github.com/microsoft/vscode/blob/6d62e3b80b950cd38294bf09083c93334aa5ec15/src/vs/workbench/contrib/terminal/browser/links/terminalLinkOpeners.ts#L116

@wolmir wolmir added the A: lsp DVC Language Server label Sep 26, 2022
@wolmir wolmir force-pushed the dvc-lsp-initial-files-on-load branch from 79b66a2 to b0096e7 Compare September 26, 2022 16:18
export default {
devtool: 'source-map',
entry: r('./src/server'),
module: {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Identical blocks of code found in 2 locations. Consider refactoring.

@wolmir wolmir changed the title Send initial YAML and JSON files right after language client starts Send initial YAML and JSON files right after language client starts (2/3) Sep 26, 2022
@wolmir wolmir force-pushed the dvc-lsp-initial-files-on-load branch from b0096e7 to 1f6a83b Compare September 26, 2022 18:28
@qlty-cloud-legacy
Copy link

Code Climate has analyzed commit 1f6a83b and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (85% is the threshold).

This pull request will bring the total coverage in the repository to 96.9%.

View more on Code Climate.

@wolmir wolmir merged commit f4ce682 into main Sep 26, 2022
@wolmir wolmir deleted the dvc-lsp-initial-files-on-load branch September 26, 2022 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A: lsp DVC Language Server product PR that affects product

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants