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

Mejoras autocomplete en Body #165

Merged
merged 3 commits into from
May 29, 2024
Merged

Mejoras autocomplete en Body #165

merged 3 commits into from
May 29, 2024

Conversation

ivojawer
Copy link
Contributor

@ivojawer ivojawer commented May 24, 2024

fix #155

  • Los bodies (test/singleton) ahora autocompletan las variables de su scope
  • Los tests ahora tambien autocompletan los fields del describe y los wko del proyecto
  • Ordenar completions para tests/methods (variables -> parametros -> atributos -> modulos -> snippets)
  •  Cuando el cursor estan en medio de una sentencia malformada assert.equals( analizar el contexto
    • Esto me parece que merece un issue a parte, por ahora con las opciones que ofrece el body me conformo

@ivojawer ivojawer requested review from PalumboN and fdodino May 24, 2024 21:18
Copy link

codecov bot commented May 24, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 82.99%. Comparing base (f2b95be) to head (12acec8).

Files Patch % Lines
...r/src/functionalities/autocomplete/autocomplete.ts 66.66% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #165      +/-   ##
==========================================
- Coverage   83.44%   82.99%   -0.46%     
==========================================
  Files          17       17              
  Lines         435      441       +6     
  Branches       97       99       +2     
==========================================
+ Hits          363      366       +3     
- Misses         72       75       +3     
Flag Coverage Δ
lsp-ide-client 93.28% <ø> (ø)
lsp-ide-server 78.50% <83.33%> (-0.57%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@fdodino fdodino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Qué lujo este PR por favor!!!
<3 <3 <3 🍾 🥇 🎦

Lo único que me estaría bueno es ver una pequeñita demo (un gif).

server/src/functionalities/autocomplete/autocomplete.ts Outdated Show resolved Hide resolved
server/src/functionalities/references.ts Outdated Show resolved Hide resolved
@@ -82,3 +88,5 @@ const completeNew = (node: New): CompletionItem[] =>
const availableForImport = (node: Node) => (node.is(Class) || node.is(Singleton) || node.is(Reference) || node.is(Mixin)) && node.name && (node as Entity).fullyQualifiedName && !implicitImport(node)

const completeImports = (node: Import) => (node.environment.descendants.filter(availableForImport) as Entity[]).map(entityCompletionItem)

const completeAllSigletons = (originNode: Node) => (originNode.environment.descendants.filter(node => node.is(Singleton) && !node.isClosure()) as Singleton[]).map(withImport(singletonCompletionItem)(originNode))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A futuro podríamos tener un helper en wollok-ts que nos de allSingletons para un environment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sii, y tambien allWKOs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debería ser allGlobals y contemplar también las const globales.

Tal vez estaría bueno un método Node.isGlobal 🤔

@ivojawer
Copy link
Contributor Author

Dejo un mini ejemplo de como quedo!

image
Screen.Recording.2024-05-28.at.12.58.34.AM.mov

Copy link
Contributor

@PalumboN PalumboN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯 🚘 🧭 💻

@@ -82,3 +88,5 @@ const completeNew = (node: New): CompletionItem[] =>
const availableForImport = (node: Node) => (node.is(Class) || node.is(Singleton) || node.is(Reference) || node.is(Mixin)) && node.name && (node as Entity).fullyQualifiedName && !implicitImport(node)

const completeImports = (node: Import) => (node.environment.descendants.filter(availableForImport) as Entity[]).map(entityCompletionItem)

const completeAllSigletons = (originNode: Node) => (originNode.environment.descendants.filter(node => node.is(Singleton) && !node.isClosure()) as Singleton[]).map(withImport(singletonCompletionItem)(originNode))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debería ser allGlobals y contemplar también las const globales.

Tal vez estaría bueno un método Node.isGlobal 🤔

): Node {
): Node | undefined {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😶

@PalumboN PalumboN merged commit 42ea358 into master May 29, 2024
5 of 6 checks passed
@PalumboN PalumboN deleted the autocomplete-test-body branch May 29, 2024 21:54
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.

Problemas autocompletado en el body de un test
3 participants