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

feat: dim ignored fields #745

Closed
wants to merge 5 commits into from
Closed

Conversation

carmenberndt
Copy link
Contributor

closes #689

@carmenberndt
Copy link
Contributor Author

carmenberndt commented Mar 17, 2021

image

Comment on lines +15 to +43
export function greyOutIgnoredParts(
document: TextDocument,
lines: string[],
): Diagnostic[] {
const diagnostics: Diagnostic[] = []

lines.map((currElement, index) => {
if (currElement.includes('@@ignore')) {
const block = getBlockAtPosition(index, lines)
if (block) {
diagnostics.push({
range: { start: block.start, end: block.end },
message: 'This model is ignored because it is invalid.',
tags: [DiagnosticTag.Unnecessary],
severity: DiagnosticSeverity.Information,
})
}
} else if (currElement.includes('@ignore')) {
diagnostics.push({
range: {
start: { line: index, character: 0 },
end: { line: index, character: Number.MAX_VALUE },
},
message: 'This field is ignored because it refers to an invalid model.',
tags: [DiagnosticTag.Unnecessary],
severity: DiagnosticSeverity.Information,
})
}
})
Copy link
Member

Choose a reason for hiding this comment

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

This seems the relevant part about greying/dim

# Conflicts:
#	packages/language-server/src/MessageHandler.ts
@Jolg42 Jolg42 added kind/improvement An improvement to existing feature and code. process/candidate Candidate for next Milestone. team/schema Issue for team Schema. topic: language server and removed process/candidate Candidate for next Milestone. labels Oct 29, 2021
@Jolg42
Copy link
Member

Jolg42 commented Nov 14, 2022

Replaced by #1285

@Jolg42 Jolg42 closed this Nov 14, 2022
@Jolg42 Jolg42 deleted the grey_out_ignored_fields branch November 14, 2022 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement An improvement to existing feature and code. team/schema Issue for team Schema. topic: language server
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dim models that are @@ignored and fields that are @ignored
2 participants