Skip to content

Commit

Permalink
Continue following selection when the active file is a TS file (#6244)
Browse files Browse the repository at this point in the history
**Problem:**
Now that you can `cmd`+click to jump to the definition of a symbol in
code, it's easy to end up in a `.d.ts` file. #5259 restricted code
selection following to only code files, but was missing `.ts` files
since we don't support TS.

**Fix:**
Include the `.ts` file extension in
`shouldFollowSelectionWithActiveFile`

**Manual Tests:**
I hereby swear that:

- [x] I opened a hydrogen project and it loaded
- [x] I could navigate to various routes in Preview mode
  • Loading branch information
Rheeseyb authored Aug 21, 2024
1 parent 9b9231b commit 587233a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utopia-vscode-extension/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,8 @@ function shouldFollowSelectionWithActiveFile() {
filePath.endsWith('.js') ||
filePath.endsWith('.jsx') ||
filePath.endsWith('.cjs') ||
filePath.endsWith('.mjs')
filePath.endsWith('.mjs') ||
filePath.endsWith('.ts')
const isComponentDescriptor = filePath.startsWith('/utopia/') && filePath.endsWith('.utopia.js')
return isJs && !isComponentDescriptor
}

0 comments on commit 587233a

Please sign in to comment.