tools icon indicating copy to clipboard operation
tools copied to clipboard

πŸ› VSCode Extension: The file does not exist in the workspace

Open mattp0123 opened this issue 2 years ago β€’ 6 comments

Environment information

CLI:
  Version:                      12.0.0
  Color support:                true

Platform:
  CPU Architecture:             aarch64
  OS:                           macos

Environment:
  ROME_LOG_DIR:                 unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v18.14.1"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "pnpm/8.3.1"

Rome Configuration:
  Status:                       Loaded successfully
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    true

Workspace:
  Open Documents:               0

Discovering running Rome servers...

Running Rome Server: ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

i The client isn't connected to any server but rage discovered this running Rome server.

Server:
  Version:                      12.0.0
  Name:                         rome_lsp
  CPU Architecture:             aarch64
  OS:                           macos

Workspace:
  Open Documents:               0

Other Active Server Workspaces:

Workspace:
  Open Documents:               0
  Client Name:                  Visual Studio Code
  Client Version:               1.77.2

Workspace:
  Open Documents:               0
  Client Name:                  Visual Studio Code
  Client Version:               1.77.2

Workspace:
  Open Documents:               0
  Client Name:                  Visual Studio Code
  Client Version:               1.77.2

Workspace:
  Open Documents:               4
  Client Name:                  Visual Studio Code
  Client Version:               1.77.2

Workspace:
  Open Documents:               1
  Client Name:                  Visual Studio Code
  Client Version:               1.77.2

Workspace:
  Open Documents:               0
  Client Name:                  Visual Studio Code
  Client Version:               1.77.2

Rome Server Log:

! Please review the content of the log file before sharing it publicly as it may contain sensitive information:
  * Path names that may reveal your name, a project name, or the name of your employer.
  * Source code

β”œβ”€β”rome_lsp::server::initialize{capabilities=ClientCapabilities { workspace: None, text_document: None, window: None, general: None, experimental: None }, client_info=ClientInfo { name: "rome_service", version: Some("12.0.0") }}
β”‚ β”œβ”€0ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€β”˜
β”œβ”€β”rome_lsp::server::rome/rage{params=RageParams}
β”œβ”€β”˜
β”œβ”€7294280ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€β”rome_lsp::handlers::analysis::code_actions{uri=file:///Users/matt/path/to/my/project/src/index.ts, range=Range { start: Position { line: 0, character: 0 }, end: Position { line: 0, character: 0 } }, only=None, diagnostics=[]}
β”‚ β”œβ”€0ms ERROR rome_lsp::handlers::analysis error=The file does not exist in the workspace.
β”œβ”€β”˜
β”œβ”€7345311ms ERROR rome_lsp::utils Error: The file does not exist in the workspace.
β”œβ”€β”rome_lsp::handlers::analysis::code_actions{uri=file:///Users/matt/path/to/my/project/src/index.ts, range=Range { start: Position { line: 49, character: 48 }, end: Position { line: 49, character: 48 } }, only=None, diagnostics=[]}
β”‚ β”œβ”€0ms ERROR rome_lsp::handlers::analysis error=The file does not exist in the workspace.
β”œβ”€β”˜
β”œβ”€7347946ms ERROR rome_lsp::utils Error: The file does not exist in the workspace.
β”œβ”€β”rome_lsp::server::initialize{capabilities=ClientCapabilities { workspace: None, text_document: None, window: None, general: None, experimental: None }, client_info=ClientInfo { name: "rome_service", version: Some("12.0.0") }}
β”‚ β”œβ”€0ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€β”˜
β”œβ”€β”rome_lsp::server::rome/rage{params=RageParams}
β”œβ”€β”˜
β”œβ”€7352565ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€β”rome_lsp::server::initialize{capabilities=ClientCapabilities { workspace: None, text_document: None, window: None, general: None, experimental: None }, client_info=ClientInfo { name: "rome_service", version: Some("12.0.0") }}
β”‚ β”œβ”€0ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€β”˜
β”œβ”€β”rome_lsp::server::rome/rage{params=RageParams}
β”œβ”€β”˜
β”œβ”€7363345ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)
β”œβ”€β”rome_lsp::handlers::analysis::code_actions{uri=file:///Users/matt/path/to/my/project/src/index.ts, range=Range { start: Position { line: 0, character: 0 }, end: Position { line: 0, character: 0 } }, only=None, diagnostics=[]}
β”‚ β”œβ”€0ms ERROR rome_lsp::handlers::analysis error=The file does not exist in the workspace.
β”œβ”€β”˜
β”œβ”€7366963ms ERROR rome_lsp::utils Error: The file does not exist in the workspace.
β”œβ”€β”rome_lsp::handlers::analysis::code_actions{uri=file:///Users/matt/path/to/my/project/src/index.ts, range=Range { start: Position { line: 49, character: 48 }, end: Position { line: 49, character: 48 } }, only=None, diagnostics=[]}
β”‚ β”œβ”€0ms ERROR rome_lsp::handlers::analysis error=The file does not exist in the workspace.
β”œβ”€β”˜
β”œβ”€7367210ms ERROR rome_lsp::utils Error: The file does not exist in the workspace.
β”œβ”€β”rome_lsp::server::initialize{capabilities=ClientCapabilities { workspace: None, text_document: None, window: None, general: None, experimental: None }, client_info=ClientInfo { name: "rome_service", version: Some("12.0.0") }}
β”‚ β”œβ”€0ms INFO rome_lsp::server Starting Rome Language Server...
β”œβ”€β”˜
β”œβ”€β”rome_lsp::server::rome/rage{params=RageParams}
β”œβ”€β”˜
β”œβ”€7368579ms ERROR tower_lsp::transport failed to encode message: failed to encode response: Socket is not connected (os error 57)

What happened?

Steps:

  1. Open a diff view by clicking the file with change at vscode source control panel
  2. Open the file in normal view and click any line of this file
  3. Got error shows up at bottom right corner says: Request textDocument/codeAction failed. with Go to output button
  4. Got the error message:
The file does not exist in the workspace.
[Error - 2:04:02 PM] Request textDocument/codeAction failed.
  Message: The file does not exist in the workspace.
  Code: -32603

Expected result

It shouldn't throw any error.

Code of Conduct

  • [X] I agree to follow Rome's Code of Conduct

mattp0123 avatar Apr 20 '23 06:04 mattp0123

Thank you for the report! Have you tried the nightly version? It seems that it should be fixed.

denbezrukov avatar Apr 20 '23 06:04 denbezrukov

i have met the problem too.it happens when i doing git operation in vscode everytime

liantianyun avatar Apr 21 '23 04:04 liantianyun

Same here, both on Windows & Linux, and the codebase is not that big...

davidsmorais avatar May 01 '23 13:05 davidsmorais

@liantianyun @davidsmorais have you both tried the nightly version? That should have fixed the issue.

ematipico avatar May 02 '23 12:05 ematipico

@liantianyun @davidsmorais have you both tried the nightly version? That should have fixed the issue.

I have briefly tried the nightly version and the issue seems to be fixed. Since this is an intermittent behavior, I'll report back here if the issue persists.

Thanks πŸ‘

davidsmorais avatar May 02 '23 19:05 davidsmorais

@ematipico Still happening with the nightly version installed on the project.

Running windows 11 with PowerShell

davidsmorais avatar May 05 '23 12:05 davidsmorais