Title: VSCode shows unexpected problem on valid ts codes after v1.68.1 · Issue #50191 · microsoft/TypeScript · GitHub
Open Graph Title: VSCode shows unexpected problem on valid ts codes after v1.68.1 · Issue #50191 · microsoft/TypeScript
X Title: VSCode shows unexpected problem on valid ts codes after v1.68.1 · Issue #50191 · microsoft/TypeScript
Description: Does this issue occur when all extensions are disabled?: Yes VS Code Version: 1.68.1, 1.69.2, 1.70.0 OS Version: Windows_NT x64 Steps to Reproduce: Create a new file, select the language as Typescript. Type in the code below: class A { s...
Open Graph Description: Does this issue occur when all extensions are disabled?: Yes VS Code Version: 1.68.1, 1.69.2, 1.70.0 OS Version: Windows_NT x64 Steps to Reproduce: Create a new file, select the language as Typescr...
X Description: Does this issue occur when all extensions are disabled?: Yes VS Code Version: 1.68.1, 1.69.2, 1.70.0 OS Version: Windows_NT x64 Steps to Reproduce: Create a new file, select the language as Typescr...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/50191
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"VSCode shows unexpected problem on valid ts codes after v1.68.1","articleBody":"\u003c!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->\r\n\u003c!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->\r\n\u003c!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->\r\n\u003c!-- 🔎 Search existing issues to avoid creating duplicates. -->\r\n\u003c!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->\r\n\u003c!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->\r\n\u003c!-- 🔧 Launch with `code --disable-extensions` to check. -->\r\nDoes this issue occur when all extensions are disabled?: Yes\r\n\r\n\u003c!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->\r\n\u003c!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->\r\n- VS Code Version: 1.68.1, 1.69.2, 1.70.0\r\n- OS Version: Windows_NT x64\r\n\r\nSteps to Reproduce:\r\n\r\n1. Create a new file, select the language as Typescript.\r\n2. Type in the code below:\r\n```ts\r\nclass A {\r\n static Foo = class {}\r\n}\r\n\r\nclass AFoo extends A.Foo {}\r\n```\r\n\r\nThis is valid typescript, and it works OK in v1.67.2 and prior versions.\r\nHowever, in v1.68.1 and newer(tested in 1.68.1, 1.69.2, 1.70.0), the editor shows two unexpected problems: \r\n`Cannot find name 'A'.ts(2304)`\r\n`'A' only refers to a type, but is being used as a namespace here.ts(2702)`\r\n\r\nScreenshots for comparison:\r\n1.67.2\r\n\r\n\r\n1.68.1\r\n\r\n\r\n\r\n\r\nNotice that this code works OK in [Typescript Playground v4.7.3](https://www.typescriptlang.org/play?ts=4.7.3#code/MYGwhgzhAECC0G8CwAoa7oQC5iwS2GgDEB7E6AXmlEhgQF9VGVUapoAhaAUwA8tuAOwAmMWADpS5BkA) (which is bundled by VSCode v1.68.1), so I suppose it may be caused by vscode itself rather than the tsserver.\r\n\r\n\r\n---\r\n(updated 2022.9.4) Add two similar cases:\r\n```ts\r\nconst B = {\r\n Foo: class { } \r\n}\r\n\r\nnamespace C {\r\n export class Foo { }\r\n}\r\n\r\nclass BFoo extends B.Foo {\r\n // ^ error here, expect no error\r\n}\r\nclass CFoo extends C.Foo {\r\n // ^ no error as expected\r\n}\r\n```\r\n\r\n","author":{"url":"https://github.com/whzx5byb","@type":"Person","name":"whzx5byb"},"datePublished":"2022-08-04T19:16:36Z","url":"https://github.com/microsoft/TypeScript/issues/50191"}
| 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:9791e63c-5017-c608-6327-1d4d3ad15ec0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 891E:1D86C4:251BDD5:2F20A47:6B018AFF |
| html-safe-nonce | baab5f335d369b9708205e03c06d889da72fa401a9dc7671b4a938fb4d493593 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4OTFFOjFEODZDNDoyNTFCREQ1OjJGMjBBNDc6NkIwMThBRkYiLCJ2aXNpdG9yX2lkIjoiMTc3MDM1MTI4NjAyMjE0NjgxNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9a98bc9bcc1af1e046f9a6d01a1cb5c7ec5ac37a194a88c40af18cd2ce266fe7 |
| hovercard-subject-tag | issue:1329138588 |
| 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/TypeScript/50191/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8b20d182ce47b52685f332b7a4379af68c0461c4761a7575fd1b9addbba71282/microsoft/TypeScript/issues/50191 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8b20d182ce47b52685f332b7a4379af68c0461c4761a7575fd1b9addbba71282/microsoft/TypeScript/issues/50191 |
| og:image:alt | Does this issue occur when all extensions are disabled?: Yes VS Code Version: 1.68.1, 1.69.2, 1.70.0 OS Version: Windows_NT x64 Steps to Reproduce: Create a new file, select the language as Typescr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | whzx5byb |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width