-
Notifications
You must be signed in to change notification settings - Fork 13.2k
CodeMapper support #55406
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
CodeMapper support #55406
Conversation
|
Thanks for the PR! It looks like you've changed the TSServer protocol in some way. Please ensure that any changes here don't break consumers of the current TSServer API. For some extra review, we'll ping @sheetalkamat, @mjbvz, @zkat, and @joj for you. Feel free to loop in other consumers/maintainers if necessary. |
cce4168 to
5db93cc
Compare
It would help if you explained what this even is. |
|
Kat is a team member, no need to be hasty 🙂 |
|
@fatcerberus sorry for the lack of clarity. We're working internally on a new codeaction-like feature, and I wanted to put up this PR to help coordinate between my team (the VS side, mainly, with some tsserver), and the VS Code team implementing this on their end. We'll have more details when more details are actually relevant to share :) |
0ff44a6 to
9bb8233
Compare
7c0d35c to
83442f8
Compare
83442f8 to
05c8862
Compare
|
Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page. Also, please make sure @DanielRosenwasser and @RyanCavanaugh are aware of the changes, just as a heads up. |
d49995b to
b92490c
Compare
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
disable synchronization for now Update src/server/session.ts Co-authored-by: Nathan Shively-Sanders <[email protected]> Update src/services/mapCode.ts Co-authored-by: Nathan Shively-Sanders <[email protected]> Update src/services/mapCode.ts Co-authored-by: Nathan Shively-Sanders <[email protected]> Update src/services/mapCode.ts Co-authored-by: Nathan Shively-Sanders <[email protected]> format some review changes more review fixes review more passing tests rejigger how class member replacement works to match statements algo starting baseline-based mapcode tests baseline-based tests review bring back synchronizeHostData syntax operation change move to operating on one file at a time Update src/server/protocol.ts Co-authored-by: Sheetal Nandi <[email protected]> Update src/server/protocol.ts Co-authored-by: Sheetal Nandi <[email protected]> Update src/server/protocol.ts Co-authored-by: Sheetal Nandi <[email protected]> Update src/server/protocol.ts Co-authored-by: Sheetal Nandi <[email protected]> Update src/server/protocol.ts Co-authored-by: Sheetal Nandi <[email protected]> Update src/server/session.ts Co-authored-by: Sheetal Nandi <[email protected]> Update src/server/session.ts Co-authored-by: Sheetal Nandi <[email protected]> Update src/services/mapCode.ts Co-authored-by: Sheetal Nandi <[email protected]> Update src/services/types.ts Co-authored-by: Sheetal Nandi <[email protected]> Update src/services/mapCode.ts Co-authored-by: Sheetal Nandi <[email protected]> more review fixes
714e82b to
4925fe9
Compare
sheetalkamat
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We recommend that PRs should squash commits after requesting review. Please add more commits instead of squashing as it becomes difficult to track history. We merge PR as a squash commit so it wont affect the merge commit. But squashing commits between reviews makes it difficult to review.
58eeb9e to
054ce2d
Compare
CodeMappers are a new language service feature that's designed to work as a deterministic aid to code generators like Copilot. The endpoint takes some arbitrary, generated code, some "focus locations" (generally things like cursor location, current selected method scope range, etc), and tries to "place" the AI-generated code in "the right place". While deterministic, it's fairly heuristic.
This version is able to also target "things that look like they match", like functions with the same name, or if statements with the same condition and actually replace their definitions/bodies, instead of appending them to the given scope.
The intention is to make it easier to go from asking an AI assistant like copilot "give me code to do this", to code that actually fits where it's supposed to. Having the language service do this lets us make more informed decisions than what a simple diff codemapper (the default) might be able to do.