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

Class member completion crash in a monorepo utilizing baseUrl #60533

Open
Andarist opened this issue Nov 18, 2024 · 0 comments
Open

Class member completion crash in a monorepo utilizing baseUrl #60533

Andarist opened this issue Nov 18, 2024 · 0 comments

Comments

@Andarist
Copy link
Contributor

πŸ”Ž Search Terms

baseurl class member completions

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

N/A

πŸ’» Code

tests/cases/fourslash/server/completionsClassMembersBaseUrlNoCrash1.ts:

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

// @Filename: /home/src/workspaces/solution/package.json
//// {
////   "name": "monorepo-like",
//// }

// @Filename: /home/src/workspaces/solution/tsconfig.json
//// {
////   "compilerOptions": {
////     "moduleResolution": "node",
////     "paths": {
////       "*": ["../../app/node_modules/*"],
////       "tabby-*": ["../../tabby-*/src"],
////     }
////   }
//// }

// @Filename: /home/src/workspaces/solution/tabby-core/package.json
//// {
////   "name": "tabby-core"
//// }

// @Filename: /home/src/workspaces/solution/tabby-core/tsconfig.json
//// {
////   "extends": "../tsconfig.json"
//// }

// @Filename: /home/src/workspaces/solution/tabby-core/src/index.ts
//// import { Subject } from "rxjs";
////
//// export abstract class BaseTabComponent {
////   protected recoveryStateChangedHint = new Subject<void>();
//// }

// @Filename: /home/src/workspaces/solution/tabby-settings/package.json
//// {
////   "name": "tabby-settings",
////   "peerDependencies": {
////     "rxjs": "^7"
////   }
//// }

// @Filename: /home/src/workspaces/solution/tabby-settings/tsconfig.json
//// {
////   "extends": "../tsconfig.json",
////   "compilerOptions": {
////     "baseUrl": "src"
////   }
//// }

// @Filename: /home/src/workspaces/solution/tabby-settings/components/settingsTab.component.ts
//// import { BaseTabComponent } from "tabby-core";
//// export class SettingsTabComponent extends BaseTabComponent {
////   /*1*/
//// }

// @Filename: /home/src/workspaces/solution/app/package.json
//// {
////   "name": "tabby"
//// }

// @Filename: /home/src/workspaces/solution/app/tsconfig.json
//// {}

// @Filename: /home/src/workspaces/solution/app/node_modules/rxjs/package.json
//// {
////   "name": "rxjs"
//// }

// @Filename: /home/src/workspaces/solution/app/node_modules/rxjs/index.d.ts
//// export declare class Subject<T> {}

// @Filename: /home/src/workspaces/solution/node_modules/rxjs/package.json
//// {
////   "name": "rxjs"
//// }

// @Filename: /home/src/workspaces/solution/node_modules/rxjs/index.d.ts
//// export declare class Subject<T> {}

verify.completions({
  marker: "1",
  includes: [
    {
      name: "recoveryStateChangedHint",
      insertText: "protected recoveryStateChangedHint: Subject<void>;",
      filterText: "recoveryStateChangedHint",
      hasAction: true,
      source: "ClassMemberSnippet/",
    },
  ],
  preferences: {
    includeCompletionsWithInsertText: true,
    includeCompletionsWithClassMemberSnippets: true,
  },
  isNewIdentifierLocation: true,
}).andApplyCodeAction({
  /* TODO */
});

πŸ™ Actual behavior

it crashes with:

Req #3582 - completionInfo
    at Object.addImportFromExportedSymbol (/typescript-5.8.0-dev.20241117/lib/typescript.js:157407:13)
    at /typescript-5.8.0-dev.20241117/lib/typescript.js:164705:38
    at importSymbols (/typescript-5.8.0-dev.20241117/lib/typescript.js:164705:11)
    at Object.addNewNodeForMemberSymbol (/typescript-5.8.0-dev.20241117/lib/typescript.js:164058:11)
    at getEntryForMemberCompletion (/typescript-5.8.0-dev.20241117/lib/typescript.js:166975:22)
    at createCompletionEntry (/typescript-5.8.0-dev.20241117/lib/typescript.js:166815:35)
    at getCompletionEntriesFromSymbols (/typescript-5.8.0-dev.20241117/lib/typescript.js:167458:19)
    at completionInfoFromData (/typescript-5.8.0-dev.20241117/lib/typescript.js:166448:23)
    at Object.getCompletionsAtPosition (/typescript-5.8.0-dev.20241117/lib/typescript.js:165981:24)
    at Object.getCompletionsAtPosition2 [as getCompletionsAtPosition] (/typescript-5.8.0-dev.20241117/lib/typescript.js:152198:35)
    at IOSession.getCompletions (/typescript-5.8.0-dev.20241117/lib/typescript.js:194948:54)
    at completionInfo (/typescript-5.8.0-dev.20241117/lib/typescript.js:193222:43)
    at /typescript-5.8.0-dev.20241117/lib/typescript.js:195725:15
    at IOSession.executeWithRequestId (/typescript-5.8.0-dev.20241117/lib/typescript.js:195714:14)
    at IOSession.executeCommand (/typescript-5.8.0-dev.20241117/lib/typescript.js:195723:29)
    at IOSession.onMessage (/typescript-5.8.0-dev.20241117/lib/typescript.js:195771:68)
    at Interface.<anonymous> (/typescript-5.8.0-dev.20241117/lib/_tsserver.js:495:14)

πŸ™‚ Expected behavior

It shouldn't crash

Additional information about the issue

repro bases on #60527 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant