Skip to content

Conversation

@chris-a-talbot
Copy link
Collaborator

This is a big one - added many new interdependent features.

Major Features

Eidos file support: Full language server support for .eidos files with appropriate feature filtering
    Added language configuration for .eidos file extension in package.json
    Eidos files only receive Eidos-specific completions, hover info, and documentation
Performance improvements: Document caching system to reduce redundant parsing
Enhanced type inference: Comprehensive type resolution for variables, constants, and expressions

New Utilities

file-type.ts: Determines file type (.eidos vs .slim) and filters features accordingly
logger.ts: Connection-aware logging system with fallback to console logging
document-cache.ts: Version-aware caching system for parsed document state
text-processing.ts: HTML entity decoding (using he library - resolves issue https://github.com/slim-community/slim-vscode-tools/issues/6), type name cleaning, and signature formatting
markdown.ts: Centralized markdown generation for hover tooltips and completion documentation
type-manager.ts: Type inference engine for expressions, variables, and SLiM-specific patterns (e.g., p1, m1)
hover-resolvers.ts: Modular hover resolution logic separated from provider code

Services

completion-service.ts: Refactored completion logic into dedicated service class
    Supports context-aware completions for methods, properties, functions, callbacks, and types
    Integrates with type inference for better suggestions
documentation-service.ts: Turned documentation retrieval and management into a service
    Loads operator documentation from eidos_operators.json
    Improved error handling and logging

Improvements to Existing Files
instance.ts

Tracks pseudo-parameters (e.g., mut, individual, subpop) within callback scopes
Detects model type (WF vs nonWF) from initializeSLiMModelType()
Tracks defined constants, mutation types, genomic element types, interaction types, subpopulations, species, and script blocks

handlers.ts

Initializes DocumentationService and CompletionService instances
Creates LanguageServerContext object for passing shared state
Registers document cache cleanup on document close

hover.ts

Refactored to use hover-resolvers.ts for cleaner separation of concerns

extension.ts

Status bar now dynamically shows "Run Eidos" or "Run SLiM" based on active file

Test Files

Added test.eidos: Lotka-Volterra predator-prey dynamics simulator (pure Eidos implementation)

@andrewkern
Copy link
Collaborator

@chris-a-talbot -- any chance you could rebase this one before I review? looks like there are a bunch of already merged commits on this somehow e.g., f245a7e

@andrewkern
Copy link
Collaborator

i.e.

git fetch upstream
git rebase -i upstream/main

@chris-a-talbot
Copy link
Collaborator Author

@andrewkern fixed it - not sure how it became such a mess but I'll try to keep it cleaner for the last few

Copy link
Collaborator

@andrewkern andrewkern left a comment

Choose a reason for hiding this comment

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

okay @chris-a-talbot I went through this and it looks great overall. I did find one issue here with some commands note being registered and failing silently

@andrewkern
Copy link
Collaborator

one question here-- it looks to me like these commands will automatically open the doc pane when autocompletion is triggered -- is that the intent?

…it tests, other small tweaks based on testing
@chris-a-talbot
Copy link
Collaborator Author

Opening the docs every time definitely wasn't the intent, thanks for catching that - I didn't realize that was what that would be doing! I resolved that issue, and make some other adjustments with fresh post-Thanksgiving eyes and a bit more thorough testing. Let me know if there's anything else you catch from this update.

@chris-a-talbot
Copy link
Collaborator Author

This version is probably big enough to justify a new release on the GitHub too? I was planning to continue labeling future PRs 0.0.11, 0.0.12, etc., but could this feasibly be 0.1.0?

@andrewkern
Copy link
Collaborator

okay @chris-a-talbot this looks good to go. I'm going to squash and merge. as for versioning-- maybe lets keep this at v0.0.10 and let's brainstorm on an issue about what a v0.1 release would look like? it would be great to do some thinking about what that would look like.

@andrewkern andrewkern merged commit 49f299d into slim-community:main Dec 1, 2025
1 check passed
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.

2 participants