-
Notifications
You must be signed in to change notification settings - Fork 22
[WIP]give a try with typescript #70
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: SamYuan1990 <[email protected]>
|
Hi thanks for the PR!
It extracts the parameters, output types and receiver for a function. The thing confusing you might be that FunctionSymbol does it on the semantic tokens of a function, instead of the function ast / verbatim. I'll try to add some tests in a few days for Python and C. Consider the # testdata/python/2_class
class Foo:
def __init__(self):
self.x = 5
def bar(self, v: int) -> int:
self.x += v
return self.x Add some loggings in FunctionSymbol and we have
So
It has no receiver token (method info is collected in the ImplSymbol function). |
That's a valid point! Hardcode is fine until final submission. You might skip looking for the For the lsp args, we have some alternatives
What do you suggest @AsterDY ? Let's move those functions into per-language specs and just register them in |
Just saw someone is working on typescript |
thanks @Hoblovski
after
btw, I am not sure if so which means those are int as location/index from LSP server, may I know how to convert LSP server response into array for int? |
We could use some better examples. Still that might have to wait a few days until I've got the time.
Just fixed some indentation error in the original diagram. The functionsymbol output basically says "bar depends on int (input) and int (output)".
During preprocessing (in |
please let me know once there a PR with further examples. :-) |
I do not have much time for PR, but I made this: How FunctionSymbol is used:
So it's used to make dependencies. You mentioned integers. They are indices into
Another examplecode: class Bar:
pass
class Foo:
def met(self) -> tuple[Bar, Foo]:
return Bar(), self
So
ExplanationSo it's all about the **token index **
|
emmm, I will catch up if I have time this week. |
There is another Typescript PR #72 is being reviewed, see if there is any possibility of cooperation? |
For my opinion, AST parser or language server has different impls, so... data process logic should focus on language specific and make it works for either AST parser, or language server. |
let me leave pr comments away at this moment as POC....
this PR is give a try for #64 as typescript part, I tried with typescript-language-server to set up a typescript-language-server support as part of #64 support, and I started local attempted.
with this PR just show me the code style for what's going on, as you can see many to do and hard code.
issues found:
FunctionSymbol
for typescript Spec, as it's hard to understand the spec interface and there seems zero test case as current spec(python and c), so... what's that?What type of PR is this?
Check the PR title.
(Optional) Translate the PR title into Chinese.
(Optional) More detailed description for this PR(en: English/zh: Chinese).
en:
zh(optional):
(Optional) Which issue(s) this PR fixes:
(optional) The PR that updates user documentation: