-
Notifications
You must be signed in to change notification settings - Fork 173
Auto-create temporary .csproj file if none exists #560
Conversation
|
Thanks for the review, @ricardo-espinoza! I made a few additional changes in response to the discussion with @bettinaheim in this PR; probably enough that I'd be most comfortable if you could give the new changes a quick look before merging. |
|
out of curiosity, why is there a need to even generate a temporary csproj? it seems at first glance like a bit of an overkill but perhaps I am missing some details. couldn't the language server just create in memory e.g. in OmniSharp we support loose |
Thanks @filipw, very good question. Including @ricardo-espinoza here also. I agree that this approach is a bit of overkill. My understanding from the code and from discussion with @bettinaheim is that the way the language server is currently set up to get change notifications, it is completely dependent on watching for changes in the file system. So it would be a bit of a more involved change to add support for something outside the file system. Certainly doable though... this was just the less-invasive approach. I think it's something we could potentially build on top of this... if we made that change later, it would be a nice improvement and (hopefully) totally invisible to the user experience... |
This PR is an attempt to allow Q# language server features to work even without a
.csprojfile. (For example, this may be common in simple Python scripting scenarios where the user has simply a.pyfile and a.qsfile.)When a
.qsfile is opened in the editor, if no local.csprojcan be found, the language server automatically generates and saves a.csprojfile in a temporary folder.The temporary
.csprojfile is a Q# library project referencing theMicrosoft.Quantum.Sdkversion that matches the version of the language server.The temporary
.csprojfile specifies aQsharpCompileproperty that includes all.qsfiles in the folder of the currently-opened.qsfile, but not subfolders..csprojfile..qsfile from a folder at the root of a large tree, e.g., theC:\folder.