Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language server does not recognize files that have been added or changed #299

Closed
chaozwn opened this issue Jun 29, 2023 · 20 comments
Closed

Comments

@chaozwn
Copy link

chaozwn commented Jun 29, 2023

volar must work with watchman?

@yaegassy
Copy link
Owner

Installation of watchman is recommended, not required. Check this section of the README.

@chaozwn
Copy link
Author

chaozwn commented Jun 29, 2023

Installation of watchman is recommended, not required. Check this section of the README.

but after brew install watchman, new add file also can't be identify by volar lsp. Restart server works well.

@yaegassy
Copy link
Owner

You can check if watchman is working properly by

  1. Execute :CocCommand workspace.showOutput command
  2. Choose watchman

In this state, create a vue file or ts, etc file in your project and save the file. If there is a change on the watchman screen side, it is working correctly.

@chaozwn
Copy link
Author

chaozwn commented Jun 29, 2023

You can check if watchman is working properly by

  1. Execute :CocCommand workspace.showOutput command
  2. Choose watchman

In this state, create a vue file or ts, etc file in your project and save the file. If there is a change on the watchman screen side, it is working correctly.

Although Watchman has logs, the notifications are still not functioning properly.

@chaozwn
Copy link
Author

chaozwn commented Jun 29, 2023

You can check if watchman is working properly by

  1. Execute :CocCommand workspace.showOutput command
  2. Choose watchman

In this state, create a vue file or ts, etc file in your project and save the file. If there is a change on the watchman screen side, it is working correctly.

image

@yaegassy
Copy link
Owner

yaegassy commented Jun 29, 2023

It seems to be working fine in my environment. I have tried the following steps. I am using the latest version of @yaegassy/coc-volar.

DEMO(mp4)

coc-volar-issue-299-1.mp4

  1. Create a vue project using create-vue.

    mkdir -p $HOME/check
    cd $HOME/check
    npm init vue@latest check-issue-299
    
    cd check-issue-299
    npm i
    
  2. open src/App.vue.

  3. Create a new FooBar component (components/FooBar.vue).

  4. Try to import FooBar component in App.vue.

@chaozwn
Copy link
Author

chaozwn commented Jun 30, 2023

sorry, i test through copy older files.if you copy components/FooBar.vue to components/FooBar2.vue. Work normal?
By the way, have you configured your watchman to ignore node_modules? Can you show me your commonly used .watchmanconfig?

@chaozwn
Copy link
Author

chaozwn commented Jun 30, 2023

It seems to be working fine in my environment. I have tried the following steps. I am using the latest version of @yaegassy/coc-volar.

DEMO(mp4)

coc-volar-issue-299-1.mp4

  1. Create a vue project using create-vue.
    mkdir -p $HOME/check
    cd $HOME/check
    npm init vue@latest check-issue-299
    
    cd check-issue-299
    npm i
    
  2. open src/App.vue.
  3. Create a new FooBar component (components/FooBar.vue).
  4. Try to import FooBar component in App.vue.

in this way, i work normal.

@yaegassy
Copy link
Owner

There are no settings regarding the watchman. In my environment, if I copy a component, of course it will reflect that as well.

@chaozwn
Copy link
Author

chaozwn commented Jun 30, 2023

There are no settings regarding the watchman. In my environment, if I copy a component, of course it will reflect that as well.
Can you please paste your dot configuration?

@yaegassy
Copy link
Owner

By the way, I will also tell you how to check the logs at the language server level.

When coc.nvim detects changes in watchman, it sends the files to the language server with the LSP method workspace/didChangeWatchedFiles.

In coc-settings.json, set "vue-semantic-server.trace.server": "verbose"

coc-volar-issue-299-2.mp4

@chaozwn
Copy link
Author

chaozwn commented Jun 30, 2023

By the way, I will also tell you how to check the logs at the language server level.

When coc.nvim detects changes in watchman, it sends the files to the language server with the LSP method workspace/didChangeWatchedFiles.

In coc-settings.json, set "vue-semantic-server.trace.server": "verbose"

coc-volar-issue-299-2.mp4

In fact, it only works the first time, and afterwards, when I add files again, it can't recognize them.
image
image

@chaozwn
Copy link
Author

chaozwn commented Jun 30, 2023

i copy demo2.vue, it works well. but when create demo3.vue, demo4.vue. it's bad.

@yaegassy
Copy link
Owner

It may be a problem with the language server itself. Please check the issue on the language server itself or report the issue. If possible, it would be easier for maintainers to understand the problem if they can reproduce it in VSCode.

@yaegassy yaegassy changed the title npm new package with watchman make tsserver down. Language server does not recognize files that have been added or changed Jun 30, 2023
@yaegassy
Copy link
Owner

Changed the title of the issue.

@chaozwn
Copy link
Author

chaozwn commented Jun 30, 2023

It may be a problem with the language server itself. Please check the issue on the language server itself or report the issue. If possible, it would be easier for maintainers to understand the problem if they can reproduce it in VSCode.

Are you experiencing the same issue as me?

@yaegassy
Copy link
Owner

yaegassy commented Jun 30, 2023

Yes. It reproduced. It also reproduces with another LSP client plugin for Vim/Neovim, so perhaps it will reproduce with VSCode as well.

@chaozwn
Copy link
Author

chaozwn commented Jun 30, 2023

Yes. It reproduced. It also reproduces with another LSP client plugin for Vim/Neovim, so perhaps it will reproduce with VSCode as well.

i found it has the same issue in vscode too.
image

@chaozwn
Copy link
Author

chaozwn commented Jun 30, 2023

so, link volar issue: vuejs/language-tools#3344

@yaegassy
Copy link
Owner

I believe this problem has been resolved in version 2 of the language server. coc-volar has also changed its language server to version 2.

You are probably currently using Neovim's built-in lsp feature, but if a case arises where you need coc.nvim, try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants