Skip to content

Support environments with no tsconfig or jsconfig#1052

Open
NullVoxPopuli wants to merge 2 commits intomainfrom
nvp/jsconfig
Open

Support environments with no tsconfig or jsconfig#1052
NullVoxPopuli wants to merge 2 commits intomainfrom
nvp/jsconfig

Conversation

@NullVoxPopuli
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli commented Feb 4, 2026

This tweaks the logic for when glint should activate (which has to happen independent of opening a file (for vscode reasons))

To test it out:

glint2-vscode-1.0.3-no-config.zip

@NullVoxPopuli NullVoxPopuli marked this pull request as draft February 4, 2026 22:59
@fdeters
Copy link

fdeters commented Feb 4, 2026

Related issue with repro: #1051

@NullVoxPopuli NullVoxPopuli changed the title Easier jsconfig/gjs testing Support environments with no tsconfig or jsconfig Feb 5, 2026
@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review February 7, 2026 15:47
@NullVoxPopuli NullVoxPopuli marked this pull request as draft February 7, 2026 22:00
@NullVoxPopuli NullVoxPopuli added the enhancement New feature or request label Feb 11, 2026
@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review February 11, 2026 00:56
Copy link
Contributor

@evoactivity evoactivity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple of things.

@void-mAlex
Copy link

tried on windows with a brand new ember app based on
pnpm dlx ember-cli@latest new my-app-name -b @ember/app-blueprint --pnpm --skip-npm --no-git --no-welcome
result is

[Activation] Activating Glint language server (Glint file detected).
Workspace ember-tsc not found (source: auto); using bundled ember-tsc from .../.vscode\extensions\typed-ember.glint2-vscode-1.0.3\node_modules\glint-ember-tsc-pack\bin\glint-language-server.js
typescript.configurePlugin not available; falling back to tsserver request. command 'typescript.configurePlugin' not found
Workspace ember-tsc not found; using bundled ember-tsc from .../.vscode\extensions\typed-ember.glint2-vscode-1.0.3\node_modules\glint-ember-tsc-pack\bin\glint-language-server.js
[Info  - 10:22:14 PM] [Glint] Language server initializing.
[Info  - 10:22:14 PM] [Glint] Workspace folders: file://.../my-app-name
[Info  - 10:22:15 PM] [Glint] No TypeScript installation found from /dev/null.
[Warn  - 10:22:15 PM] [Glint] Glint config not found for /dev/null/inferredProject1*; Glint features disabled.

@NullVoxPopuli
Copy link
Contributor Author

@void-mAlex but did your editor have the expected behavior? or no?

@void-mAlex
Copy link

once I added

    "@glint/ember-tsc": "^1.1.1",
    "@glint/template": "^1.7.4",

to the package json; pnpm installed; + reloaded dev window in vs code

[Activation] Activating Glint language server (Glint file detected).
Using workspace ember-tsc from ...\my-app-name\node_modules\.pnpm\@glint+ember-tsc@1.1.1_typescript@5.9.3\node_modules\@glint\ember-tsc\bin\glint-language-server.js
typescript.configurePlugin not available; falling back to tsserver request. command 'typescript.configurePlugin' not found

@void-mAlex
Copy link

@NullVoxPopuli
this is what the editor looks like after the last steps
image

@NullVoxPopuli
Copy link
Contributor Author

NullVoxPopuli commented Feb 16, 2026

Note for myself -- find a way to make this the default jsconfig for no-config situations:

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "experimentalDecorators": true,
    "skipLibCheck": true,
    "strict": false,
    "checkJs": false,
    "noEmit": true,
    "isolatedModules": true,
    "allowImportingTsExtensions": false,
    "resolveJsonModule": true,
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "types": [
      "ember-source/types",
      "@embroider/core/virtual",
      "vite/client",
      "@glint/ember-tsc/types"
    ],
  },
  "exclude": ["dist", "node_modules"]
}

from https://discord.com/channels/480462759797063690/1470939378871435557/1473088988561674324

@evoactivity
Copy link
Contributor

evoactivity commented Feb 20, 2026

tried on windows with a brand new ember app based on pnpm dlx ember-cli@latest new my-app-name -b @ember/app-blueprint --pnpm --skip-npm --no-git --no-welcome

This is exactly what I did on windows too, worked first time, no need to add deps manually.
Strange 🤔

@void-mAlex
Copy link

tried on windows with a brand new ember app based on pnpm dlx ember-cli@latest new my-app-name -b @ember/app-blueprint --pnpm --skip-npm --no-git --no-welcome

This is exactly what I did on windows too, worked first time, no need to add deps manually. Strange 🤔

the extension doesn't activate without the packages which are not in the default bp for non ts projects - it says as much in the extension log
also no ide features were working to suggest glint was doing anything on a gjs file

@evoactivity
Copy link
Contributor

evoactivity commented Feb 21, 2026

image image image

🤷 I can use features like rename symbol from the template too without that extra config

@NullVoxPopuli
Copy link
Contributor Author

do you two have different setups somehow?

@evoactivity
Copy link
Contributor

Presumably we do, mine is a clean vscode install on windows 11. It's not my dev machine, I just thought it was worth testing under windows so got it setup.

@void-mAlex
Copy link

I'm on good ol' win 10
the big difference lies with likely me not having the extension pack and by 'extension' the els extension
image

@NullVoxPopuli
Copy link
Contributor Author

when I tested on macOS, I only had Glint V2 installed 🤔

@void-mAlex
Copy link

you need template syntax surely ...

@NullVoxPopuli
Copy link
Contributor Author

it's unrelated to ts/glint

@void-mAlex
Copy link

unrelated, sure, but you can't really use the ide without it, might as well go code in notepad at that point there wouoldn't be much difference

@NullVoxPopuli
Copy link
Contributor Author

I tried again on a super fresh js project on macos, and have this partial experience:
image

image

So, the template processing isn't active, but we have some intellisense in the js region of components

@void-mAlex
Copy link

what global packages do you have installed? wondering if that affects things as I have no such package especially ember-tsc/typescript

@NullVoxPopuli
Copy link
Contributor Author

I don't install things globally, so none 🎉

@evoactivity
Copy link
Contributor

I tried again on a super fresh js project on macos, and have this partial experience
So, the template processing isn't active, but we have some intellisense in the js region of components

I see the same if I create a class component

image

I added @glint/template and @glint/ember-tsc and then I saw the problem @void-mAlex sees, because the updates you've added will not be used if a workspace copy of @glint/ember-tsc is available, since that package on npm is not updated with these changes.

image

Comment on lines 40 to 45
public configForDirectory(directory: string): GlintConfig | null {
let ts = findTypeScript(directory);
if (!ts) {
this.log(`No TypeScript installation found from ${directory}.`);
return null;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If typescript is not installed in the project none of the following code runs.

If you remove return null we end up with breakage,.

Adding typescript then makes it run, and in volar labs I can see the virtual file, but we still end up with any types in the template.

A combination of typescript, @glint/ember-tsc (with the glint config setting telling vscode to use the bundled copy) and this jsconfig.js file makes things work

{
  "compilerOptions": {
    "module": "ESNext",
    "moduleResolution": "bundler",
  }
}

I don't have time now to keep digging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants