LuaLS / LuaLS/lua-language-server
Process types/annotations in a file but not it's actual content
Personne n'a encore pris cette issue.
- Langage dominant
- Lua
- Étoiles
- 4.4k
- Forks
- 442
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
I use Lua both as programming language and as file format for storing data and dynamicaly loading it into Lua enviroment. Usually this data is generated, saved and loaded during a single script execution. These files are pretty big and contain a single value of known type which is returned.
Since these files are huge, they shouldn't be processed in a usual manner. Thus, they should be put into `Lua.workspace.ignoreDir` list. However, in that case the type of returned value will not processed as well (actually, it is processed as long as the file is opened, but once it's closed, language server forgets its type. Here is an example of such behaviour. `filters.lua` is a big table of words that are to be filtered during text processing)


I tried to put `---@meta` annotation in that file in hopes that contents of returned table would not be processed but they were which was unexpected. I tried to use `---@diagnostic disable` annotation but it seems that the file still is being diagnosted. I also tried to put `---@return table` annotation on top of the file (since each `lua` file is basically a function) but this annotation is ignored.
So right now, it seems that a file can be either ignored or processed entirely. Is there a way to somehow specify types in a file but disable all other processing of it?
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par reproduire le comportement avec une grande table renvoyée répertoriée dans Lua.workspace.ignoreDir, puis comparez-le aux effets signalés de @meta, @diagnostic disable et @return table. Suivez le traitement des fichiers ignorés et des annotations après la fermeture du fichier. Le travail est terminé lorsqu’un fichier peut conserver les informations de type qu’il exporte tout en évitant l’analyse et les diagnostics de son contenu réel.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- lua
- Domaine
- devtools
- Type d'issue
- Fonctionnalité
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100