Title: Symbols returned with wrong kind. · Issue #1 · microsoft/python-language-server · GitHub
Open Graph Title: Symbols returned with wrong kind. · Issue #1 · microsoft/python-language-server
X Title: Symbols returned with wrong kind. · Issue #1 · microsoft/python-language-server
Description: In the VS Code Python extension we are sending a textDocument/documentSymbol request and using the result to position code lenses. The data we get back is mostly correct. However, the "kind" (i.e. VS Code's SymbolKind) is consistently of...
Open Graph Description: In the VS Code Python extension we are sending a textDocument/documentSymbol request and using the result to position code lenses. The data we get back is mostly correct. However, the "kind" (i.e. ...
X Description: In the VS Code Python extension we are sending a textDocument/documentSymbol request and using the result to position code lenses. The data we get back is mostly correct. However, the "kind&qu...
Opengraph URL: https://github.com/microsoft/python-language-server/issues/1
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Symbols returned with wrong kind.","articleBody":"In the VS Code Python extension we are sending a `textDocument/documentSymbol` request and using the result to position code lenses. The data we get back is mostly correct. However, the \"kind\" (i.e. VS Code's [SymbolKind](https://code.visualstudio.com/docs/extensionAPI/vscode-api#SymbolKind)) is consistently off by one. For example, using the following Python code:\r\n\r\n```python\r\nimport unittest\r\n\r\nclass SpamTests(unittest.TestCase):\r\n def test_all(self):\r\n self.assertTrue(False)\r\n```\r\nI got the following JSON response from the language server (formatted for clarity):\r\n\r\n```json\r\n[{\r\n \"name\":\"SpamTests\",\r\n \"detail\":\"SpamTests\",\r\n \"kind\":5,\r\n \"deprecated\":false,\r\n \"range\":{\r\n \"start\":{\"line\":2,\"character\":6},\r\n \"end\":{\"line\":2,\"character\":15}\r\n },\r\n \"selectionRange\":{\r\n \"start\":{\"line\":2,\"character\":6},\r\n \"end\":{\"line\":2,\"character\":15}\r\n },\r\n \"children\":[{\r\n \"name\":\"test_all\",\r\n \"detail\":\"test_all\",\r\n \"kind\":12,\r\n \"deprecated\":false,\r\n \"range\":{\r\n \"start\":{\"line\":3,\"character\":4},\r\n \"end\":{\"line\":4,\"character\":30}\r\n },\r\n \"selectionRange\":{\r\n \"start\":{\"line\":3,\"character\":4},\r\n \"end\":{\"line\":4,\"character\":30}\r\n },\r\n \"children\":[{\r\n \"name\":\"self\",\r\n \"detail\":\"self\",\r\n \"kind\":13,\r\n \"deprecated\":false,\r\n \"range\":{\r\n \"start\":{\"line\":3,\"character\":17},\r\n \"end\":{\"line\":3,\"character\":21}\r\n },\r\n \"selectionRange\":{\r\n \"start\":{\"line\":3,\"character\":17},\r\n \"end\":{\"line\":3,\"character\":21}\r\n },\r\n \"children\":[],\r\n \"_functionKind\":\"\"\r\n }],\r\n \"_functionKind\":\"function\"\r\n },\r\n {\r\n \"name\":\"assertTrue\",\r\n \"detail\":\"assertTrue\",\r\n \"kind\":13,\r\n \"deprecated\":false,\r\n \"range\":{\r\n \"start\":{\"line\":0,\"character\":0},\r\n \"end\":{\"line\":0,\"character\":0}\r\n },\r\n \"selectionRange\":{\r\n \"start\":{\"line\":0,\"character\":0},\r\n \"end\":{\"line\":0,\"character\":0}\r\n },\r\n \"children\":[],\r\n \"_functionKind\":\"\"\r\n }],\r\n \"_functionKind\":\"class\"\r\n}]\r\n```\r\n\r\nEach of the `\"kind\"` fields is 1 more than it should be:\r\n\r\n`SpamTests` -> 5; should be 4 ([`SymbolKind.Class`](https://code.visualstudio.com/docs/extensionAPI/vscode-api#SymbolKind))\r\n`test_all` -> 12; should be 11 ([`SymbolKind.Function`](https://code.visualstudio.com/docs/extensionAPI/vscode-api#SymbolKind))\r\n`self` -> 13; should be 12 ([`SymbolKind.Variable`](https://code.visualstudio.com/docs/extensionAPI/vscode-api#SymbolKind))\r\n`assertTrue` -> 13; should be 12 ([`SymbolKind.Variable`](https://code.visualstudio.com/docs/extensionAPI/vscode-api#SymbolKind))\r\n\r\nFWIW, the Jedi-related code in the Python extension gets it right.","author":{"url":"https://github.com/ericsnowcurrently","@type":"Person","name":"ericsnowcurrently"},"datePublished":"2018-08-30T21:13:14Z","url":"https://github.com/microsoft/python-language-server/issues/1"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7d2675a6-43ff-3f65-4cd6-fbc834fb79a6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AB0C:262F52:A9DC83:DD6429:6AFE802B |
| html-safe-nonce | 3f8b3633bb2370982a2ced4d122632ef429c7668917b668b6c5e920336cf58d8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQjBDOjI2MkY1MjpBOURDODM6REQ2NDI5OjZBRkU4MDJCIiwidmlzaXRvcl9pZCI6IjM2MzQ0NDEzNzgyNDAyOTkwNTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a8ebb3c32e75cfddc3f089dd9bcd5ab88a23272bdd456402623d5a5abd454ea1 |
| hovercard-subject-tag | issue:355756478 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/python-language-server/1/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8df773f0bfbfb76a4b63629964c8c0c65b2fe5aa91f5ad07dc792384b5274d6b/microsoft/python-language-server/issues/1 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8df773f0bfbfb76a4b63629964c8c0c65b2fe5aa91f5ad07dc792384b5274d6b/microsoft/python-language-server/issues/1 |
| og:image:alt | In the VS Code Python extension we are sending a textDocument/documentSymbol request and using the result to position code lenses. The data we get back is mostly correct. However, the "kind" (i.e. ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ericsnowcurrently |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/python-language-server git https://github.com/microsoft/python-language-server.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 145901977 |
| octolytics-dimension-repository_nwo | microsoft/python-language-server |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 145901977 |
| octolytics-dimension-repository_network_root_nwo | microsoft/python-language-server |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width