Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 27 additions & 7 deletions src/cdl_lsp/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,20 +124,40 @@

FEATURE_NAMES: set[str] = {
# Growth features
"phantom", "sector", "zoning", "skeletal", "dendritic",
"phantom",
"sector",
"zoning",
"skeletal",
"dendritic",
# Surface features
"striation", "trigon", "etch_pit", "growth_hillock",
"striation",
"trigon",
"etch_pit",
"growth_hillock",
# Inclusion features
"inclusion", "needle", "silk", "fluid", "bubble",
"inclusion",
"needle",
"silk",
"fluid",
"bubble",
# Color features
"colour", "colour_zone", "pleochroism",
"colour",
"colour_zone",
"pleochroism",
# Other
"lamellar", "banding",
"lamellar",
"banding",
}

PHENOMENON_TYPES: set[str] = {
"asterism", "chatoyancy", "adularescence", "labradorescence",
"play_of_color", "colour_change", "aventurescence", "iridescence",
"asterism",
"chatoyancy",
"adularescence",
"labradorescence",
"play_of_color",
"colour_change",
"aventurescence",
"iridescence",
}

# Default point group for each system
Expand Down
4 changes: 1 addition & 3 deletions src/cdl_lsp/features/definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ def _create_location(file_path: str, line: int, character: int = 0) -> Any:
)


def _find_definition_in_document(
name: str, document_text: str, document_uri: str
) -> Any | None:
def _find_definition_in_document(name: str, document_text: str, document_uri: str) -> Any | None:
"""
Find a @name definition in the document text.

Expand Down
4 changes: 1 addition & 3 deletions src/cdl_lsp/features/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,7 @@ def _check_modification_typos(
break # Only report first occurrence


def _check_feature_names(
line_text: str, line_num: int, diagnostics: list[DiagnosticInfo]
) -> None:
def _check_feature_names(line_text: str, line_num: int, diagnostics: list[DiagnosticInfo]) -> None:
"""Check for invalid feature names in [...] blocks after forms."""
# Find feature brackets: }[...] or }@scale[...]
for match in re.finditer(r"\}(?:@[\d.]+)?\[([^\]]+)\]", line_text):
Expand Down
Loading