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

Syntax highlighting is not workin with Remote-SSH #5522

Closed
rary21 opened this issue Feb 27, 2024 · 3 comments
Closed

Syntax highlighting is not workin with Remote-SSH #5522

rary21 opened this issue Feb 27, 2024 · 3 comments
Assignees
Labels
needs repro Issue has not been reproduced yet

Comments

@rary21
Copy link

rary21 commented Feb 27, 2024

Environment data

  • Language Server version: 2024.2.2
  • OS and version: linux x64 (WSL2)
  • Python version (and distribution if applicable, e.g. Anaconda): 3.11.4 with poetry
  • python.analysis.indexing: true
  • python.analysis.typeCheckingMode: standard

Code Snippet

I couldn't reproduce this issue with minimum code snipet.
This happens only in my company source codebase.

Repro Steps

  1. Remote-SSH to WSL2 on a remote PC
  2. Open a workspace
  3. Browse python files
  4. Some python files does not have semanticTokens information that I can check with Developer: Inspect Editor Tokens and Scopes,
    while other python files have it.

However, I couldn't reproduce this issue with sample workspace.
It works fine when I use VSCode-insiders on a remote PC directly.

Expected behavior

semanticTokens is available.

Actual behavior

semanticTokens is not available.

Logs

I added following settings to enable log.

        "python.analysis.logLevel": "Trace",
        "python.trace.server": "verbose",

I captured the log by

  1. close editors
  2. clear output in Python Language Server
  3. open a file

As I mentioned, this issue can be reproduced only in my company codebase so I replaced some sensitive information in the log.
I found that the response for textDocument/semanticTokens/full is empty.

2024-02-27 15:18:53.844 [info] [Trace - 3:18:53 PM] Sending notification 'textDocument/didOpen'.
2024-02-27 15:18:53.844 [info] Params: {
    "textDocument": {
        "uri": <URI>,
        "languageId": "python",
        "version": 1,
        "text": <source code>
    }
}


2024-02-27 15:18:53.844 [info] [Trace - 3:18:53 PM] Sending request 'textDocument/codeAction - (342)'.
2024-02-27 15:18:53.844 [info] Params: {
    "textDocument": {
        "uri": <URI>
    },
    "range": {
        "start": {
            "line": 0,
            "character": 0
        },
        "end": {
            "line": 0,
            "character": 0
        }
    },
    "context": {
        "diagnostics": [],
        "triggerKind": 2
    }
}


2024-02-27 15:18:53.844 [info] [Trace - 3:18:53 PM] Sending request 'textDocument/documentSymbol - (343)'.
2024-02-27 15:18:53.844 [info] Params: {
    "textDocument": {
        "uri": <path>
    }
}


2024-02-27 15:18:53.844 [info] [Trace - 3:18:53 PM] Sending request 'textDocument/semanticTokens/full - (344)'.
2024-02-27 15:18:53.844 [info] Params: {
    "textDocument": {
        "uri": <path>
    }
}


2024-02-27 15:18:53.845 [info] [Trace - 3:18:53 PM] Received response 'textDocument/documentSymbol - (343)' in 1ms.
2024-02-27 15:18:53.846 [info] Result: [
    <seems valid response>
]


2024-02-27 15:18:53.847 [info] [Trace - 3:18:53 PM] Received response 'textDocument/codeAction - (342)' in 3ms.
2024-02-27 15:18:53.847 [info] Result: []


2024-02-27 15:18:53.847 [info] [Trace - 3:18:53 PM] Received response 'textDocument/semanticTokens/full - (344)' in 3ms.
2024-02-27 15:18:53.847 [info] Result: {
    "data": []
}


2024-02-27 15:18:53.848 [info] [Trace - 3:18:53 PM] Received notification 'window/logMessage'.
2024-02-27 15:18:53.848 [info] Params: {
    "type": 4,
    "message": "(339966) Background analysis message: getSemanticTokens full"
}


2024-02-27 15:18:53.848 [info] (339966) Background analysis message: getSemanticTokens full
2024-02-27 15:18:53.848 [info] [Trace - 3:18:53 PM] Sending request 'textDocument/inlayHint - (345)'.
2024-02-27 15:18:53.848 [info] Params: {
    "textDocument": {
        "uri": <path>
    },
    "range": {
        "start": {
            "line": 0,
            "character": 0
        },
        "end": {
            "line": 102,
            "character": 23
        }
    }
}


2024-02-27 15:18:53.848 [info] [Trace - 3:18:53 PM] Received notification 'window/logMessage'.
2024-02-27 15:18:53.848 [info] Params: {
    "type": 4,
    "message": "(339966) [BG(2)] getSemanticTokens full at <path> (0ms)"
}


2024-02-27 15:18:53.848 [info] (339966) [BG(2)] getSemanticTokens full at <path> (0ms)
2024-02-27 15:18:53.848 [info] [Trace - 3:18:53 PM] Received response 'textDocument/inlayHint - (345)' in 0ms.
2024-02-27 15:18:53.848 [info] No result returned.


2024-02-27 15:18:53.892 [info] [Trace - 3:18:53 PM] Sending request 'textDocument/documentSymbol - (346)'.
2024-02-27 15:18:53.892 [info] Params: {
    "textDocument": {
        "uri": <path>
    }
}


2024-02-27 15:18:53.893 [info] [Trace - 3:18:53 PM] Received response 'textDocument/documentSymbol - (346)' in 1ms.
2024-02-27 15:18:53.893 [info] Result: [
    <seems valid response>
]


2024-02-27 15:18:54.078 [info] [Trace - 3:18:54 PM] Sending request 'textDocument/codeAction - (347)'.
2024-02-27 15:18:54.079 [info] Params: {
    "textDocument": {
        "uri": <path>
    },
    "range": {
        "start": {
            "line": 27,
            "character": 0
        },
        "end": {
            "line": 27,
            "character": 0
        }
    },
    "context": {
        "diagnostics": [],
        "triggerKind": 2
    }
}


2024-02-27 15:18:54.081 [info] [Trace - 3:18:54 PM] Received response 'textDocument/codeAction - (347)' in 3ms.
2024-02-27 15:18:54.081 [info] Result: []


2024-02-27 15:18:54.130 [info] [Trace - 3:18:54 PM] Sending request 'textDocument/foldingRange - (348)'.
2024-02-27 15:18:54.130 [info] Params: {
    "textDocument": {
        "uri": <path>
    }
}


2024-02-27 15:18:54.130 [info] [Trace - 3:18:54 PM] Sending request 'textDocument/documentSymbol - (349)'.
2024-02-27 15:18:54.130 [info] Params: {
    "textDocument": {
        "uri": <path>
    }
}


2024-02-27 15:18:54.133 [info] [Trace - 3:18:54 PM] Received response 'textDocument/foldingRange - (348)' in 3ms.
2024-02-27 15:18:54.133 [info] Result: [
    <seems valid>
]


2024-02-27 15:18:54.134 [info] [Trace - 3:18:54 PM] Received response 'textDocument/documentSymbol - (349)' in 4ms.
2024-02-27 15:18:54.134 [info] Result: [
    <seems valid>
]


2024-02-27 15:18:54.386 [info] [Trace - 3:18:54 PM] Received notification 'window/logMessage'.
2024-02-27 15:18:54.386 [info] Params: {
    "type": 4,
    "message": "(339966) [BG(3)] indexing: <path> [found 2] (0ms)"
}


2024-02-27 15:18:54.386 [info] (339966) [BG(3)] indexing: <path> [found 2] (0ms)
2024-02-27 15:18:54.386 [info] [Trace - 3:18:54 PM] Received notification 'window/logMessage'.
2024-02-27 15:18:54.386 [info] Params: {
    "type": 4,
    "message": "(339966) Indexing Done: <path>
}


2024-02-27 15:18:54.386 [info] (339966) Indexing Done: <path>
2024-02-27 15:18:54.387 [info] [Trace - 3:18:54 PM] Received notification 'window/logMessage'.
2024-02-27 15:18:54.387 [info] Params: {
    "type": 4,
    "message": "(339966) [BG(1)] indexing: <path> [found 2] (1ms)"
}


2024-02-27 15:18:54.387 [info] (339966) [BG(1)] indexing: <path> [found 2] (1ms)
2024-02-27 15:18:54.387 [info] [Trace - 3:18:54 PM] Received notification 'window/logMessage'.
2024-02-27 15:18:54.387 [info] Params: {
    "type": 4,
    "message": "(339966) Indexing Done: <path>
}


2024-02-27 15:18:54.387 [info] (339966) Indexing Done: <path>
2024-02-27 15:18:54.722 [info] [Trace - 3:18:54 PM] Sending request 'textDocument/codeAction - (350)'.
2024-02-27 15:18:54.722 [info] Params: {
    "textDocument": {
        "uri": <path>
    },
    "range": {
        "start": {
            "line": 26,
            "character": 0
        },
        "end": {
            "line": 26,
            "character": 0
        }
    },
    "context": {
        "diagnostics": [],
        "triggerKind": 2
    }
}


2024-02-27 15:18:54.724 [info] [Trace - 3:18:54 PM] Received response 'textDocument/codeAction - (350)' in 2ms.
2024-02-27 15:18:54.724 [info] Result: []

Related Issues:
#2897

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Feb 27, 2024
@rchiodo
Copy link
Contributor

rchiodo commented Feb 27, 2024

Thanks for the issue. I don't think there's anything we can do to solve it without a repro though. Does the file with the problem have any other errors inside of it?

@rchiodo
Copy link
Contributor

rchiodo commented Feb 27, 2024

The log indicates we're receiving the tokens request, we're just not able to process it for some reason. My guess is that there's an error in parsing that causes us to give up.

@rary21
Copy link
Author

rary21 commented Feb 28, 2024

I guess I found a way to fix this problem.
I have a workspace configuration like this.
./
|- common package
|- package1

I set both folders in *.code-workspace.
Each folder have settings.json with "python.analysis.extraPaths": [<path to another folder>].

When I removed python.analysis.extraPaths from one of the settings.json, this problem disappeared.

I have no idea why and I couldn't reproduce this issue in new repository.
This might happen only in my environment, so I'll close this issue.

@rary21 rary21 closed this as completed Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue has not been reproduced yet
Projects
None yet
Development

No branches or pull requests

2 participants