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

Errors on the console with TypeScript code fixes #1638

Closed
spahnke opened this issue Oct 21, 2019 · 3 comments
Closed

Errors on the console with TypeScript code fixes #1638

spahnke opened this issue Oct 21, 2019 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug typescript
Milestone

Comments

@spahnke
Copy link
Contributor

spahnke commented Oct 21, 2019

monaco-editor version: > 0.18.1 (not released yet)
Browser: Chrome/Edge
OS: Windows 10

Steps or JS usage snippet reproducing the issue:
microsoft/monaco-typescript#40 added support for code fixes which is not released yet. You can play around with that however in the TypeScript playground. Using the following code I get errors on the console when moving the cursor on either side of the last semicolon:

const test = 'foobar';
throw new Error(test);
test;

Playground link:
http://www.typescriptlang.org/play/index.html?ts=3.7-Beta#code/MYewdgzgLgBFCm0YF4YHIBmIQCMCGATmgNwBQUAFgSAO4xjx0CiB1BAFAtAJRldTEgA

grafik

/cc @orta

@alexdima alexdima added this to the On Deck milestone Dec 10, 2019
@alexdima alexdima added the bug Issue identified by VS Code Team member as probable bug label Dec 12, 2019
@alexdima alexdima self-assigned this Dec 13, 2019
@alexdima alexdima modified the milestones: On Deck, December 2019 Dec 16, 2019
@alexdima
Copy link
Member

I can reproduce also with the TS 3.7.3. I suggest to file an issue directly against https://github.com/microsoft/Typescript

cc @orta

@alexdima alexdima added upstream and removed bug Issue identified by VS Code Team member as probable bug labels Dec 17, 2019
@alexdima alexdima modified the milestones: December 2019, On Deck Dec 17, 2019
@alexdima alexdima removed their assignment Dec 17, 2019
@orta
Copy link
Contributor

orta commented Feb 14, 2020

Confirmed, this feels like my bug yeah 👍

@orta
Copy link
Contributor

orta commented Feb 14, 2020

Yeah, it's in the monaco-typescript implementation, the compiler didn't raise with

/// <reference path="fourslash.ts" />

//// const test = 'foobar';
//// throw new Error(test);
//// test;

verify.codeFixAll({
  fixId: "addMissingNewOperator",
  fixAllDescription: "Add missing 'new' operator to all calls",
  newFileContent:
`class C {
  constructor(num?: number) {}
}
var a = new C();
var b = new C(3);`
});

@alexdima alexdima added bug Issue identified by VS Code Team member as probable bug and removed upstream labels Feb 17, 2020
@alexdima alexdima modified the milestones: On Deck, August 2020 Sep 18, 2020
@alexdima alexdima self-assigned this Sep 18, 2020
pgherveou pushed a commit to pgherveou/monaco-typescript that referenced this issue Sep 21, 2020
pgherveou pushed a commit to pgherveou/monaco-typescript that referenced this issue Sep 21, 2020
* Format signature and parameter documentation as Markdown

* Add support for creating a custom webworker subclass

* Make a useful sample

* Tidy up

* Settle on customTSWorkerFactory

* Adds a vfs project

* Tightens the public API

* update deps

* update to [email protected]

* Add prettier

* Run prettier

* Use the global `monaco` only in the AMD case (see microsoft/monaco-editor#1974)

* Add deprecated diagnostic tag if a symbol is reported as deprecated

* Add deprecated tag to suggestion if entry is marked as deprecated

* Include tags in documentation string of suggestion items

* Align tag representation in suggestion items and hovers

* 4.0.0

* small style tweaks

* 4.0.1

* improve `.npmignore`

* Allows setting lib with shortnames

* Remove declare modifiers (microsoft/monaco-editor#2121)

* 4.0.2

* Update import TS

* Use typescript language for hover tooltip header

* update `package-lock.json`

* Adopt `async`

* Increase `printWidth`

* `var` -> `let`

* Fixes microsoft/monaco-editor#1937: Remove debugger statement

* Fixes microsoft/monaco-editor#1638: Protect against failing `getCodeFixesAtPosition` calls

* Fixes microsoft/monaco-editor#1998: make sure to always increase the version number

* Adopt latest `monaco-editor-core`, update to TS 4.0.3

* 4.1.0

* Add missing setWorkerOptions

* commit generated file

* update upstream and enable regex

Co-authored-by: Sebastian Pahnke <[email protected]>
Co-authored-by: Orta <[email protected]>
Co-authored-by: Alex Dima <[email protected]>
Co-authored-by: Spencer <[email protected]>
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug typescript
Projects
None yet
Development

No branches or pull requests

3 participants