LSP type inlay hint prefers initializer type over inherited redefinition typing
Les mainteneurs répondent en général sous 1 jour
@devin-ai-integration y travaille déjà.
Depuis le 16/11/2026.
- #2333 par @devin-ai-integration — ouverte
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 45/100
Piste de recherche
Start with inferredType in internal/workspace/model/editor_facts.go, which calls sem.ExprResultType before sem.DeclaredFeatureTypes, so the string literal's String type wins over the inherited Label typing. Reproduce with the Example package in the issue via an inlay-hint request for the whole document. Done when the hint after redefines name reflects the inherited Label typing or clearly separates the initializer type from the feature's effective type, with a test covering that case.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
What happened, and what I expected instead
For an attribute that redefines a feature typed by a custom String subtype, the language server displays : String with tooltip inferred type ScalarValues::String. This looks like the type of the feature, but it is the type of the initializer expression and omits the more specific typing inherited through the redefinition.
Expected: the hint should account for the inherited Label typing, or clearly distinguish the initializer's expression type from the feature's effective typing. This report concerns the misleading inlay hint; it does not claim that the underlying semantic model loses the inherited typing or that assignment compatibility is necessarily validated incorrectly.
Reproduction
Open this standalone model and enable inferred-type inlay hints:
package Example {
attribute def Label :> ScalarValues::String;
attribute def Record {
attribute name : Label;
}
attribute example : Record {
attribute redefines name = "example";
}
}
The hint after redefines name is : String, rather than reflecting the inherited Label typing.
Independently reproduced against sysml-lsp v0.12.1 using a fresh stdio LSP process with -no-record-cache: send initialize, initialized, textDocument/didOpen with the model above, and textDocument/inlayHint for the whole document. No model file needs to be written.
The server published an empty diagnostic list and returned:
[
{
"position": { "line": 6, "character": 32 },
"label": ": String",
"kind": 1,
"tooltip": "inferred type ScalarValues::String",
"paddingLeft": true
}
]
Suspected cause
In internal/workspace/model/editor_facts.go, inferredType first calls sem.ExprResultType(scope, usage.Value) and only consults sem.DeclaredFeatureTypes(sym) if that returns nil. A string literal therefore supplies String before inherited/redefined feature typing can inform the hint.
Source checked at the installed extension's commit:
https://github.com/Open-MBEE/OpenSysML/blob/ddc5b7a632/internal/workspace/model/editor_facts.go
Version
Original editor observation: VS Code extension open-mbee.opensysml-sysml, version 0.12.2-nightly-20261109-ddc5b7a632.
Independent LSP reproduction:
sysml-lsp v0.12.1
Commit: b2f0e9b802a334369da94312c35cefbd8726d3bf
Build time: 2026-11-06_03:25:57
Go version: go1.27.3
Surface
Language server (sysml-lsp) / VS Code extension
Platform
Linux, VS Code Remote environment.
- Langage dominant
- Go
- Étoiles
- 59
- Forks
- 20
- Merge moyen
- 10 h 23 min
- PR mergées (30 j)
- 897
Préparer son environnement
- Fournit un Dockerfile ou un fichier Docker Compose
- Propose un modèle de pull request
- Lire 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.
Autres issues de Open-MBEE/OpenSysML
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
Les mainteneurs répondent en général sous 1 jour
-
A model's parse is still paid cold in every process; the library record cache does not cover itOuverte
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 35/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 4/5 3-5 jours Accessibilité débutants 55/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 28/100
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de Open-MBEE/OpenSysML
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
krakenhavoc/cmd_and_ctrl#5853 ·
Les mainteneurs répondent en général sous 1 jour
-
flaky test: TestTRTAsyncPrefillFailures/transport reads the token load before prefillDone has released itPeut-être pris @Jackmeson1 l’a pris aujourd’hui. Ouvertearea/cicd area/gateway kind/misc
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
vllm-project/aibrix#3488 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Type: Bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
projectdiscovery/httpx#2735 ·
Les mainteneurs répondent en général sous 1 jour
-
NuGet registry builds every URL from ROOT_URL, ignoring the host the client usedPeut-être pris @gritse l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour