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

tsx files are typically typescript files #1126

Open
wants to merge 1 commit into
base: preview
Choose a base branch
from

Conversation

jaresty
Copy link

@jaresty jaresty commented Apr 15, 2024

These files were not showing it by that code search. This way might be why.

Description

[ What changed? Feel free to be brief. ]

Checklist

  • [ x] The base branch of this PR is preview, rather than main

These files were not showing it by that code search. This way might be why.
@sestinj
Copy link
Contributor

sestinj commented Apr 15, 2024

@jaresty by code search do you mean the @ codebase context provider, cmd+enter, @ files, or something else? The mapping here is for tree-sitter wasm files, and there happens to be a specific one or .tsx files that is separate from typescript, so there's likely something else causing the problem

Edit: Just saw your issue. Has this change proven to solve the problem in your testing? The main reason I can think of that this would happen is that the tree-sitter-tsx.wasm file is broken, but that seems less likely. I'm noticing in testing that it's not just tsx files that have missing functions/classes in @ code

@jaresty
Copy link
Author

jaresty commented Apr 15, 2024

I mean that when I do Code search in my project, I do see symbols but only symbols from files that end in ".ts", so my lsp is working.

I noticed that in the file I linked, these things are true:

  • ts is mapped to typescript
  • js is mapped to javascript
  • jsx is mapped to javascript
  • tsx is mapped to tsx

Since one of these look inconsistent, I'm theorizing that it could be a mistake. I'm not sure if it's the whole picture.

@jaresty
Copy link
Author

jaresty commented Apr 15, 2024

I was referring to the "Code" context provider.

image

@jaresty
Copy link
Author

jaresty commented Apr 15, 2024

I'm not sure how to test. I was hoping that someone here could help me with that.

@jaresty
Copy link
Author

jaresty commented Apr 15, 2024

A method from that file is used in the context provider as well here

@rootedbox
Copy link
Contributor

@jaresty Just a heads up TSX is another valid grammar within tree-sitter separate from typescript.. https://github.com/tree-sitter/tree-sitter-typescript

@jaresty
Copy link
Author

jaresty commented Apr 18, 2024

Isn't it also true of jsx files that they are a valid grammar too? Why is the mapping different there?

https://github.com/tree-sitter/tree-sitter-javascript

@jaresty
Copy link
Author

jaresty commented Apr 18, 2024

I'm not sure if this fixes my issue, but if you can point me in the right direction I'll experiment and try to fix it. I'm not sure how to run an extension from source code.

@sestinj
Copy link
Contributor

sestinj commented Apr 24, 2024

@jaresty true that .jsx should probably have it's own grammar, I think this is probably just because there wasn't a readily available jsx grammar found and jsx is slightly less common.

Here is a guide to getting set up and running from source: https://github.com/continuedev/continue/blob/main/CONTRIBUTING.md#environment-setup

And it seems like this function is probably where you'll want to set a conditional breakpoint to find out what's going on

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

Successfully merging this pull request may close these issues.

None yet

3 participants