continue icon indicating copy to clipboard operation
continue copied to clipboard

tsx files are typically typescript files

Open jaresty opened this issue 10 months ago • 9 comments

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

jaresty avatar Apr 15 '24 06:04 jaresty

@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

sestinj avatar Apr 15 '24 16:04 sestinj

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 avatar Apr 15 '24 18:04 jaresty

I was referring to the "Code" context provider.

image

jaresty avatar Apr 15 '24 18:04 jaresty

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

jaresty avatar Apr 15 '24 19:04 jaresty

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

jaresty avatar Apr 15 '24 19:04 jaresty

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

rootedbox avatar Apr 18 '24 06:04 rootedbox

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 avatar Apr 18 '24 13:04 jaresty

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.

jaresty avatar Apr 18 '24 14:04 jaresty

@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

sestinj avatar Apr 24 '24 07:04 sestinj

@jaresty I'm going through older PRs so wanted to check in on this. Should I close an let it come up again later, or do you plan to look into this soon?

sestinj avatar Jun 27 '24 19:06 sestinj

I'll probably look into this at some point, that I'm not using continue very much these days so I'm not sure when. I don't mind if you want to close this PR.

jaresty avatar Jun 27 '24 22:06 jaresty

Sounds good. Would be curious to hear what workflow you're enjoying most these days, but a GitHub PR might not be the best place for that : ) If you're ever around the Discord and want to nudge us in any direction, it would be really nice to hear feedback.

Appreciate you taking the time to look into this!

sestinj avatar Jun 28 '24 01:06 sestinj