You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm saying that when you have the text new. in your file and a user requests completions, you should provide the "target" as one of the suggestion items, because the user intends to write new.target.
Also does this /**/ marker have a special meaning should know about
In fourslash tests, we have functionality for emulating the way a user would type code. You type in code preceded by four slashes, and the testing infrastructure interprets that as a file. The testing infrastructure also knows that within those four slashes, /**/ is what's called a "marker comment".
You can then call functions to work with the file, and jump to those markers. For example, here's how I'd write a test for new.target in tests/cases/fourslash/completionsNewTarget.ts
/// <reference path="fourslash.ts" />////class C {//// constructor() {//// if (C === new./**/)//// }////}goTo.marker("");verify.completionListContains("target");verify.completionListCount(1);
Activity
DanielRosenwasser commentedon Apr 10, 2018
Ideally, any work here will make it easy to add completion support for
import.meta.Gregjarvez commentedon Apr 12, 2018
Yayy first issue 😀😀 with some support I would like to tackle this issue
https://github.com/Microsoft/TypeScript/blob/a004571d3ebb7da6a7d0915465829dee9874e495/src/services/completions.ts#L2113
would this be the right place to edit
Daniel Rosenwasser (@DanielRosenwasser)
DanielRosenwasser commentedon Apr 12, 2018
Hey Gregory Assasie (@Gregjarvez), awesome! I would actually look closer into:
https://github.com/Microsoft/TypeScript/blob/a004571d3ebb7da6a7d0915465829dee9874e495/src/services/completions.ts#L1012
In that function, I'd check if
nodeis a meta-property.https://github.com/Microsoft/TypeScript/blob/0feefab765214f080e5d8db37bde42830a1c8884/src/compiler/utilities.ts#L5050
Then, if the the meta-property keyword is
new, I'd serve up a single completion for the texttarget.Tests can be written in
tests/cases/fourslash, and you can take inspiration from other completions-related tests.Gregjarvez commentedon Apr 12, 2018
Pardon me for the questions and many more to come , I am new here
with regards to this statement
I'd serve up a single completion for the text target.what is the
text targetAlso does this
/**/ markerhave a special meaning should know aboutThank you :)
DanielRosenwasser commentedon Apr 12, 2018
I'm saying that when you have the text
new.in your file and a user requests completions, you should provide the "target" as one of the suggestion items, because the user intends to writenew.target.In fourslash tests, we have functionality for emulating the way a user would type code. You type in code preceded by four slashes, and the testing infrastructure interprets that as a file. The testing infrastructure also knows that within those four slashes,
/**/is what's called a "marker comment".You can then call functions to work with the file, and jump to those markers. For example, here's how I'd write a test for
new.targetintests/cases/fourslash/completionsNewTarget.ts