Skip to content

Commit 8583037

Browse files
committed
Dont look for extensions in a namespace
1 parent 8b3aeb8 commit 8583037

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

src/compiler/program.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,8 +1213,7 @@ namespace ts {
12131213
let result: any;
12141214
let error: any;
12151215
if (host.loadExtension) {
1216-
// TODO (weswig): @ts is taken on npm. Aquire it or use @tsc?
1217-
const resolved = resolveModuleName(combinePaths("@ts", name), combinePaths(currentDirectory, "tsconfig.json"), options, host, /*loadJs*/true).resolvedModule;
1216+
const resolved = resolveModuleName(name, combinePaths(currentDirectory, "tsconfig.json"), options, host, /*loadJs*/true).resolvedModule;
12181217
if (resolved) {
12191218
try {
12201219
result = host.loadExtension(resolved.resolvedFileName);

tests/cases/unittests/extensionAPI.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ export abstract class SemanticLintWalker implements tsi.LintWalker {
161161
const extensions: Map<Map<string>> = {
162162
"test-syntactic-lint": {
163163
"package.json": `{
164-
"name": "@ts/test-syntactic-lint",
164+
"name": "test-syntactic-lint",
165165
"version": "1.0.0",
166166
"description": "",
167167
"main": "index.js",
@@ -185,7 +185,7 @@ export default class IsNamedFoo extends SyntacticLintWalker {
185185
},
186186
"test-semantic-lint": {
187187
"package.json": `{
188-
"name": "@ts/test-semantic-lint",
188+
"name": "test-semantic-lint",
189189
"version": "1.0.0",
190190
"description": "",
191191
"main": "main.js",
@@ -210,7 +210,7 @@ export default class IsValueFoo extends SemanticLintWalker {
210210
},
211211
"test-extension-arguments": {
212212
"package.json": `{
213-
"name": "@ts/test-extension-arguments",
213+
"name": "test-extension-arguments",
214214
"version": "1.0.0",
215215
"description": "",
216216
"main": "index.js",
@@ -236,7 +236,7 @@ export default class IsNamedX extends SyntacticLintWalker {
236236
},
237237
"test-multi-extension": {
238238
"package.json": `{
239-
"name": "@ts/test-multi-extension",
239+
"name": "test-multi-extension",
240240
"version": "1.0.0",
241241
"description": "",
242242
"main": "index.js",
@@ -308,7 +308,7 @@ export class IsValueBar extends SemanticLintWalker {
308308
* Setup a new test, where all extensions specified in the options hash are available in a node_modules folder, alongside the extension API
309309
*/
310310
function test(sources: Map<string>, options: ExtensionTestOptions) {
311-
forEach(options.availableExtensions, ext => loadSetIntoFsAt(extensions[ext], `/node_modules/@ts/${ext}`));
311+
forEach(options.availableExtensions, ext => loadSetIntoFsAt(extensions[ext], `/node_modules/${ext}`));
312312
const diagnostics = buildMap(sources, sources, options.compilerOptions);
313313
checkDiagnostics(diagnostics, options.expectedDiagnostics);
314314
}

0 commit comments

Comments
 (0)