Comments (2)
Hi,
Yesterday, @0101, @auduchinok, and I had a chat about bringing the Transparent Compiler into Rider. We focused on how the new ProjectSnapshot setup changes the way we keep track of everything.
Here's the deal: When we make a ProjectSnapshot, each file gets a timestamp or version. This helps the system remember things, and when a file gets updated, it needs a fresh version in the snapshot. Updating a file means making a new FileSnapshot and using the .Replace function to refresh the snapshot.
This is okay but gets complicated when we talk about projects that depend on each other. Because snapshots include the projects they depend on, if you change one file, you theoretically need to update everything. Imagine having 300 projects; typing in one file would mean all those snapshots need an update every time you press a key.
From what I understand, Visual Studio doesn't rush to update everything right away when a file changes. It waits until the snapshot is needed for something before it updates it.
Our plan for now is to have a system on Rider's side that makes ProjectSnapshots from ProjectOptions. When a file changes, this system would get rid of the outdated snapshots, which helps us avoid making too many new ones. This might be a good first step for using the Transparent Compiler with Rider, but it seems like something all IDEs will have to figure out.
This is where the idea of a new Workspace comes in. It would be awesome if we could use this setup to ask for snapshots since the FSharpChecker should always work with snapshots. So, if I need type check info for a file, I could ask the Workspace for the snapshot using the project key (project name + TFM), get the snapshot, use FSharpChecker, and get my answers. And when a file changes, I just tell the Workspace. It would handle whatever needs to be done.
sequenceDiagram
participant IDE as IDE
participant Workspace as Workspace
participant FSharpChecker as FSharpChecker
IDE->>Workspace: Request ProjectSnapshot (project key)
Workspace-->>IDE: ProjectSnapshot
IDE->>FSharpChecker: Get information (ProjectSnapshot)
FSharpChecker-->>IDE: Information results
IDE->>Workspace: File changed
IDE->>Workspace: Project options changed
IDE->>Workspace: Assembly changed
This seems like a smart way to manage snapshots across different editors. The Workspace shouldn't be tied down to LSP; it should work with everything or be easy to plug into. Each editor (VS, Ionide, and Rider) could throw in their two cents on what they need from the Workspace, and we could build something that works for everyone.
@0101 had a cool idea yesterday about trying something called adaptive programming inside the Workspace. This could make handling changes across projects smoother. The thought is that the Workspace could know about file changes from the editor and only update things in a project when someone asks for that project's snapshot. It's just an idea, and I'm not sure if it's possible, but it's worth thinking about.
(//cc @TheAngryByrd & @baronfel for FSAC input)
from fsharp.
Yeah, that was the general idea - abstract it away so it's easy to work with it in some abstract editor/IDE.
from fsharp.
Related Issues (20)
- `MultipleDiagnosticsLoggers.Parallel` deadlock HOT 1
- Allow #nowarn to support the FS prefix on error codes to disable warnings HOT 3
- dotnet fsi crashes with lines longer than terminal width HOT 5
- Inline warning resulting in run time error (NotSupportedException) HOT 2
- An F# or C# shebang executable should use a cached binary on subsequent runs HOT 1
- F# files moved with by dragging HOT 1
- Enable F# Code Metrics and Analysis
- Improve onhover tooltip for visual studio HOT 1
- Support / fix replacing reference (Refactor -> Rename) of F# operator HOT 1
- [Feature request] Support solution view where projects are ordered based on number of dependent projects. HOT 2
- F# - Add Function Dependency Status to Functions/IntelliSense for F# (like C# has) HOT 1
- Internal error when dotting into delegate with 2 or more type parameters
- I'm getting unwanted navigation when holding `Ctrl` and hovering over operators like `&&` or `>`. Not sure if caused by this PR or a bug in VS. HOT 5
- Incorrect TailCall warning on async recursive functions HOT 2
- Allow #ParsedHashDirectives to have argument types other than strings HOT 1
- Provide better github.dev links for updating release notes HOT 5
- [Automated] PRs inserted in VS build main-34924.28
- Making TypeProviders easier: FS3033 needs base exception message HOT 2
- Integral range optimizations in resumable code computation expressions
- [Automated] PRs inserted in VS build main-34927.16
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fsharp.