Code Monkey home page Code Monkey logo

ionide-vscode-paket's Introduction

Enhanced F# Language Features for Visual Studio Code

Part of the Ionide plugin suite. Read detailed documentation at Ionide docs page.

Version Installs Rating open collective backers open collective sponsors

You can support Ionide development on Open Collective.

Open Collective

Features

  • Paket commands available in VS Code's Command Palette
  • Autocomplete in paket.dependencies and paket.references files
  • Support for .Net Core version of Paket installed either as local or global tool

PATH settings

  • In case of using .Net Core version, dotnet must be in PATH. (recommended)
  • In case of using Mono version, mono must be in PATH. (obsolete)

How to contribute

Imposter syndrome disclaimer: I want your help. No really, I do.

There might be a little voice inside that tells you you're not ready; that you need to do one more tutorial, or learn another framework, or write a few more blog posts before you can help me with this project.

I assure you, that's not the case.

This project has some clear Contribution Guidelines and expectations that you can read here.

The contribution guidelines outline the process that you'll need to follow to get a patch merged. By making expectations and process explicit, I hope it will make it easier for you to contribute.

And you don't just have to write code. You can help out by writing documentation, tests, or even by giving feedback about this work. (And yes, that includes giving feedback about the contribution guidelines.)

Thank you for contributing!

Contributing and copyright

The project is hosted on GitHub where you can report issues, fork the project and submit pull requests.

The library is available under MIT license, which allows modification and redistribution for both commercial and non-commercial purposes.

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

ionide-vscode-paket's People

Contributors

adamchester avatar alfonsogarciacaro avatar baronfel avatar cloudroutine avatar eugene-g avatar forki avatar isaacabraham avatar janno-p avatar kerams avatar krzysztof-cieslak avatar martin4ndersen avatar mtnrbq avatar rfrerebe avatar rmunn avatar t3dodson avatar teo-tsirpanis avatar vbfox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ionide-vscode-paket's Issues

Update to use new paket syntax when running as local tool

Issue Type: Bug

These warnings appear in the output pane when using paket with .net 6.0 rc2

Running paket as local tool
Paket version 6.2.1+c82f25d6c324024cbd231df154a447a117c2546e
Please use the new syntax: 'nuget' is the default argument and should be omitted.
Please use the new syntax: 'project' has been replaced by '--project'.

Extension version: 2.0.0
VS Code version: Code - Insiders 1.62.0-insider (bcb9df5afa52c5b713f62e86dcac2c5050504b5f, 2021-10-22T05:15:25.330Z)
OS version: Windows_NT x64 10.0.19042
Restricted Mode: No

System Info
Item Value
CPUs AMD Ryzen 5 2600 Six-Core Processor (12 x 3850)
GPU Status 2d_canvas: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: enabled_on
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.95GB (7.66GB free)
Process Argv --crash-reporter-id d15abc04-2f14-48d4-98ba-287dac26245f
Screen Reader no
VM 0%
A/B Experiments
vsliv695:30137379
vsins829:30139715
vsliv368:30146709
vsreu685:30147344
python383:30185418
pythonvspyt602:30291494
vspor879:30202332
vspor708:30202333
vspor363:30204092
pythonvspyt639:30291487
pythontb:30258533
pythonvspyt551cf:30291413
pythonptprofiler:30281269
vshan820:30294714
pythondataviewer:30285072
pythonvsuse255:30319630
vscod805:30301674
pythonvspyt200:30323110
vsccppwt:30382699
pythonvssor306:30340298
bridge0708:30335490
pygetstartedt2:30353727
bridge0723:30353136
pythonrunftest32:30365365
pythonf5test824:30361779
javagetstartedt:30350119
pythonvspyt187:30365360
pydsgst2:30361790
vsaa593:30376534
vscrecpromptt1:30387007

Running Paket commands automatically

Run paket restore on plugin start
Run paket update on paket.dependencies change
Run paket install on paket.references chage

Feature should be optional (enabled by default ? )
Good way of notification what's going on. (messages we have right now can be too intrusive, maybe add notification on bottom bar?)

Make it easier to install into a project

There's a nice feature to install a package and add to a project at the same time. However, you need to actually open up the proj file in the editor first to "select" it. This isn't especially obvious to do and a little awkward e.g. you're using Ionide's project view but need to go back to file view etc.

I suggest having the palette actually prompt you to select the project you wish to add the package to as a drop-down, if this is even possible.

Adopt extension for no reload on install

Hi, I am a developer from VS Code and in the last release 1.31, we added a new feature - no reload is required on installing an extension - https://code.visualstudio.com/updates/v1_31#_no-reload-on-install

But there are some exceptions to it as mentioned in the doc. If the extension is contributing to external contribution points, then the extension requires reload after installing. Hence, we added a new listener API for the owners of the external contribution point to listen to extension addition/removal and can update its state - https://code.visualstudio.com/updates/v1_31#_extensions-change-event.

Our plan is to give extensions one milestone/month for adopting to the above API and make the other extensions consuming their contribution points ready for no reload. It means that from next release, above exception will be removed and all extensions are added to VS Code window immediately after installation and no reload is shown.

We scanned the extensions in the marketplace and found out that this extension uses an external contribution point outputChannels and requires reload on install. Since we cannot find out which extension owns this contribution point filing an issue here and please forward it to the extension that owns this contribution point to adopt.

Thanks

Packet: Restore is still failing after installing Ionide the first time on a machine

Doing Paket: Restore on a new Ionide installation does nothing, the console window never opens

All my fsx scripts at work now have this header, I'd really like to get rid of those last 4 lines

// Getting Started
// * Install F# (Visual Studio Installer->Modify->Individual Components->Development activities->F# language support)
// * Install Visual Studio Code
// * Install the Ionide-fsharp and Ionide-Paket plugins
// * Ctrl+Shift+P -> Paket: Restore
//    * If this step doesn't work, update to the latest paket version by 
//    * deleting %userprofile%\.vscode\extensions\Ionide.ionide-paket-1.11.0\bin\paket.exe and 
//    * running %userprofile%\.vscode\extensions\Ionide.ionide-paket-1.11.0\bin\paket.bootstrapper.exe to download paket.exe
//    * and then try again

I debugged this a little bit, and the problem seems to be that paket.exe is locked, so bootstrapper hangs. If I open taskmanager, I see both paket.exe and paket.bootstrapper.exe running, and if I then kill paket.exe, the new version is downloaded, and the paket console window finally shows up in VSCode and everything works

Scaffolded projects with Paket not directly portable to another machine via source control

Out of the box, it seems like a project that is scaffolded with Paket support does not work properly when pulling it fresh from source control on a different machine. When I try

Steps to Reproduce

  1. Scaffold a new F# project
  2. Check the project into source control
  3. Clone the repo into a new machine (or separate folder on same machine)
  4. Run Paket: Init

Expected Result
5. Paket initializes
6. Profit

Actual Result
Command fails with
Error: spawn c:\src\project\.paket\paket.exe ENOENT

From what I can see, the issue is caused because the plugin uses the existence of .paket/ to determine if it should use the paket.exe local to the project, or the one installed globally. There is no way out of the box to re-bootstrap the new project with the necessary files.

The workaround for me is to delete .paket/ before opening VS Code. Then when I run Paket: Init the global executable runs and bootstraps the local project with the files it needs. This might not be acceptable to anyone who has made modifications to the paket.targets file.

Paket init in empty folder

Is your feature request related to a problem? Please describe.
I am using fsx scripts usually, so I would expect from Paket init to download paket.exe and all relevant stuff in the opened folder (in VSC).
image

Describe the solution you'd like
As mentioned above (all files are downloaded by Ionide-paket).

Describe alternatives you've considered
Otherwise, you need to use C#/F# projects, and it's working. But I prefer a more lightweight solution.

Additional context
N/A

Neither Paket nor its bootstrapper were found. It is suggested that you download the Paket boostrapper and save it as .paket/paket.exe

Describe the bug
I hadn't used VSCode+Paket in a while, and we have a couple of small projects at work that just consist of a bunch of fsx files. We used to be able to just run Paket: Init from VSCode when opening the folder for the first time on a new machine (I've put that on README.txt files all over since most people that use these scripts aren't familiar with F# or Paket at all), but now Ionide gives this error on the current version:

image

Has the functionality to auto download paket int he background and use it been removed?

Environment (please complete the following information):

  • OS: Windows 10
  • Ionide version: 4.1.0
  • VSCode version: 1.38.1
  • dotnet SDK version: 3.0.100
  • mono / .Net Framework version: 4.8

[Feature Request] Basic script generation

Ionide + Paket has potentially a very nice story for scripting thanks in part to Paket's script generation feature. However, this isn't surfaced especially well in Ionide (indeed, many people don't even know about it). I would like to see a "all-in-one" script generation feature that would:

  1. Prompt for a specific TFM (filtered by what's in dependencies file if possible)
  2. Prompt for a specific group (if more than one in dependencies file)
  3. Call generate-package-references in Paket to create reference scripts
  4. Create an .fsx file which is pre-populated with a single line in it to #load the created reference script e.g. main.group.fsx
  5. Open the script.

Brand new project fails to load after being converted from Nuget

Describe the bug
I'm trying to create a brand new console project from the Ionide command-palette and convert it to Paket.
When I reload the window, the project fails to load with a status of "failed to load" and an error of "Project not restored"

To Reproduce
Steps to reproduce the behaviour:

  1. Open VS Code in a blank directory
  2. Press Ctrl + Shift + P > F#: Create New Project
  3. Select New Console Application
  4. Name your folder and your project. I named both "TestProj"
  5. Ctrl + Shift + P > Developer: Reload Window
  6. The project should reload just fine inside Ionide
  7. Ctrl + Shift + P > Paket: Convert from Nuget (I also tried Paket: Install)
  8. Wait for command to finish
  9. Ctrl + Shift + P > Developer: Reload Window
  10. Project fails to load with errors mentioned above

Expected behaviour
The project should load within Ionide just fine.

Environment (please complete the following information):

  • OS: Windows 10
  • Ionide version: 4.14.0
  • Ionide Paket version: 2.0.0
  • Paket version: 5.215.0
  • VSCode version: 1.46.1
  • dotnet SDK version: 5.0.100-preview.4.20258.7
  • mono / .Net Framework version: net5.0

Additional context
My guess is something to do with the net5.0 TargetFramework being incompatible with Paket?

mono .paket/paket.exe generate-include-scripts failed on OSX

Tried to run `Paket: Generate Include Sripts' from inside VS Code and it failed with the message:

command 'paket.GenerateIncludeScripts' not found

VS Code version: 1.9.0
Ionide Paket version: 1.6.0
Ionide Fake version: 1.2.3
Ionide FSharp verison: 2.22.0
Mono version: 4.8
OSX Version: 10.12.13

My paket.dependencies had the following content:

source https://nuget.org/api/v2

nuget FSharp.Data framework: net45
nuget MySql.Data framework: net45
nuget Newtonsoft.Json framework: net45

I didn't have a fsproj since I was only playing around with a script file.

Paket failed

System: elementary OS 0.4 Loki (64-bit)
.NET version: .NET Core 1.0.1
Output:
Paket version 3.33.4
Paket failed with:
Could not find 'paket.dependencies'. To use Paket with this solution, please run 'paket init' first.
If you have already run 'paket.init' then ensure that 'paket.dependencies' is located in the top level directory of your repository.
Like this:
MySourceDir
.paket
paket.dependencies

Install Package does not add reference to fsproj file

When adding a new package to a project, the reference is not added to the .fsproj file
This may be because of this line in the output

Please use the new syntax: 'project' has been replaced by '--project'.

See: https://github.com/ionide/ionide-vscode-paket/blob/master/src/paket.fs#L151

c:\Users\davecar\katas\2018-03-19\.paket\paket.exe
Paket version 5.153.0
Please use the new syntax: 'nuget' is the default argument and should be omitted.
Please use the new syntax: 'project' has been replaced by '--project'.
Adding FSharp.Data to c:\Users\davecar\katas\2018-03-19\paket.dependencies into group Main
Skipping resolver for group Build since it is already up-to-date
Resolving packages for group Main:
 - Expecto 7.0
 - Expecto.FsCheck 7.0
 - FSharp.Core 4.3.4
 - FSharp.Data 2.4.5
 - Argu 5.1
 - FsCheck 2.10.8
 - Mono.Cecil 0.10.0-beta7
Locked version resolution written to c:\Users\davecar\katas\2018-03-19\paket.lock
Dependencies files saved to c:\Users\davecar\katas\2018-03-19\paket.dependencies
Adding package FSharp.Data to c:\Users\davecar\katas\2018-03-19\test\test\paket.references into group Main
References file saved to c:\Users\davecar\katas\2018-03-19\test\test\paket.references
 - Creating model and downloading packages.
Downloading FSharp.Data 2.4.5
Download of FSharp.Data 2.4.5 done in 1 second.
 - test/test/paket.references -> test/test/test.fsproj
Performance:
 - Resolver: 1 second (1 runs)
    - Runtime: 198 milliseconds
    - Blocked (retrieving package details): 1 second (5 times)
    - Blocked (retrieving package versions): 100 milliseconds (1 times)
    - Not Blocked (retrieving package details): 2 times
 - Disk IO: 1 second
 - Average Download Time: 1 second
 - Number of downloads: 1
 - Average Request Time: 173 milliseconds
 - Number of Requests: 8
 - Runtime: 6 seconds

Automated dotnet restore after install?

After you run a paket install, you still need to manually run a dotnet restore / build to get the newly installed packages to show up. Might it be worth having an automatic dotnet restore run after the install process?

Autocomplete options in `paket.dependencies`

I'm missing a feature for autocompletion of options in paket.dependencies.

E.g. typing redir should give the suggestion redirects: . After pushing enter, you should be given the alternatives on; off; force

Autocomplete does not work with dot

Type FSharp and hit CTRL + SPACE - you get suggestions.
Type FSharp. and hit CTRL + SPACE - no suggestions. I think it's because it only searches for the word after the dot e.g.

Searching for Azure.Storage comes back with suggestions for Storage

The extension does not work on repositories that have Paket in magic mode.

Just try it. The bootstrapper found in the extension's folder will hang forever, and only then will .paket\paket.exe (another bootstrapper BTW) run.

I suggest the following logic:

  1. Check if the file .paket\paket.bootstrapper.exe exists.
  2. If it does not:
  • Go to step 4.
  1. Otherwise:
  • Execute it and proceed whether it succeeds or fails (because there might be no Internet connectivity))
  1. Run .paket\paket.exe; if exists. If it does not, fail accordingly.

Can't run Paket Install or Restore

  1. Create an empty folder.
  2. Run paket init from command line (empty deps file).
  3. Run paket install from command palette.

image

I have no clue why it's talking about VS Live Share!

Download of paket never completes

Doing a paket init or similar sometimes tries to download Paket if there's a newer version available. However, sometimes it never completes:

Checking Paket version (downloading latest stable)...
Hash file of version 5.172.4 not found in cache.
Starting download from https://github.com/fsprojects/Paket/releases/download/5.172.4/paket-sha256.txt
Version 5.172.4 not found in cache.
Starting download from https://github.com/fsprojects/Paket/releases/download/5.172.4/paket.exe

I've tested that URL and it downloads within a few seconds in the browser.

Add Nuget Package Whitespace Error

Add Nuget Package (to current project) fails when the path to the fsproj file has white space in it.

example output:

c:\Users\Firstname Lastname\Demo\.paket\paket.exe
ERROR: unrecognized argument: 'Lastname\Demo\Demo\Demo.fsproj"'.

The file path is cut off at the white space between Firstname and LastName.

Windows 10 64bit
VS Code 1.6
Ionide-Paket 1.2.2

Use classical Fable libraries

Hello @Krzysztof-Cieslak , today I worked on a VSCode extension and used the "classical" Fable libraries like:

  • generated types from ts2fable
  • Fable.PowerPack for promise
  • etc.

I wonder if you would be interested if I try to port this extension to it ? I propose to test it on this extension because it's smaller compared to ionide-vscode-fsharp :)

Support DotNet CLI

It would be nice if Ionide-Paket could be configured to use dotnet paket ... instead of the outdated .paket/paket.exe call.

OS: Windows 10
Ionide version: 4.5.0
Ionide-Paket version: 1.12.0
VSCode version: 1.42.1
dotnet SDK version: 3.1.101

Unable to retrieve package versions for 'System.Slices'

Trying to install the Spreads 0.5.1 in Visual Studio Code on Ubuntu 16.04, my paket.dependency file is:

source https://www.nuget.org/api/v2/

framework: >= net461
nuget FSharp.Core

running paket add Spreads --version 0.6.1 I get:

Paket version 5.132.4
Adding Spreads 0.5.1 to /home/tom/F#/paket.dependencies into group Main
Resolving packages for group Main:
 - Spreads 0.5.1
 - FSharp.Core 4.2.3
 - Spreads.Core 0.6.1
 - Spreads.Extensions 0.5.1
Trial1 (NuGet.GetVersions) did not yield any results, trying again.
   https://www.nuget.org/api/v2/FindPackagesById()?semVerLevel=2.0.0&id='System.Slices'
   https://www.nuget.org/api/v2/Packages?semVerLevel=2.0.0&$filter=Id eq 'System.Slices'
 - Newtonsoft.Json 10.0.3
 - System.Memory 4.4.0-preview2-25405-01
     System.Memory 4.4.0-preview2-25405-01 was unlisted
 - System.Memory 4.4.0-preview1-25305-02
 - System.Runtime.CompilerServices.Unsafe 4.4.0
 - System.Numerics.Vectors 4.4.0
 - System.Buffers 4.4.0
 - System.Threading.Tasks.Extensions 4.4.0
 - NodaTime 2.2.3
Performance:
 - Resolver: 4 seconds (1 runs)
    - Runtime: 181 milliseconds
    - Blocked (retrieving package details): 506 milliseconds (6 times)
    - Blocked (retrieving package versions): 3 seconds (5 times)
    - Not Blocked (retrieving package versions): 6 times
    - Not Blocked (retrieving package details): 6 times
 - Average Request Time: 171 milliseconds
 - Number of Requests: 23
 - Runtime: 4 seconds
Paket failed with
-> Unable to retrieve package versions for 'System.Slices'
   -- CLOSED --
      Spreads 0.5.1 (from /home/tom/F#/paket.dependencies)
      FSharp.Core  (from /home/tom/F#/paket.dependencies)
      Spreads.Core >= 0.5.1 (from Spreads 0.5.1)
      Spreads.Extensions >= 0.5.1 (from Spreads 0.5.1)
      Newtonsoft.Json >= 9.0.1 (from Spreads.Core 0.6.1)
      Newtonsoft.Json >= 7.0.1 (from Spreads.Extensions 0.5.1)
      System.Memory >= 4.4.0-beta-24911-06 (from Spreads.Core 0.6.1)
      System.Runtime.CompilerServices.Unsafe >= 4.4.0-beta-24911-06 (from Spreads.Core 0.6.1)
      System.Numerics.Vectors >= 4.1.1 (from Spreads.Core 0.6.1)
      System.Buffers >= 4.0 (from Spreads.Core 0.6.1)
      System.Threading.Tasks.Extensions >= 4.0 (from Spreads.Core 0.6.1)
      NodaTime >= 1.3.1 (from Spreads.Extensions 0.5.1)
   -- OPEN ----
      System.Slices >= 0.1.0-e170111-4 (from Spreads.Core 0.6.1)
      System.Numerics.Vectors >= 4.4.0-preview1-25305-02 (from System.Memory 4.4.0-preview1-25305-02)
      System.Runtime.CompilerServices.Unsafe >= 4.4.0-preview1-25305-02 (from System.Memory 4.4.0-preview1-25305-02)
      System.Diagnostics.Debug >= 4.3 (from System.Buffers 4.4.0)
      System.Diagnostics.Tracing >= 4.3 (from System.Buffers 4.4.0)
      System.Resources.ResourceManager >= 4.3 (from System.Buffers 4.4.0)
      System.Runtime >= 4.3 (from System.Buffers 4.4.0)
      System.Threading >= 4.3 (from System.Buffers 4.4.0)
      System.Collections >= 4.3 (from System.Threading.Tasks.Extensions 4.4.0)
      System.Runtime >= 4.3 (from System.Threading.Tasks.Extensions 4.4.0)
      System.Threading.Tasks >= 4.3 (from System.Threading.Tasks.Extensions 4.4.0)
      NETStandard.Library >= 1.6.1 (from System.Memory 4.4.0-preview1-25305-02)
      NETStandard.Library >= 1.6.1 (from System.Runtime.CompilerServices.Unsafe 4.4.0)
-> Could not find versions for package System.Slices on https://www.nuget.org/api/v2.
-> Source 'https://www.nuget.org/api/v2' yielded (0): []
	-  Request 'https://www.nuget.org/api/v2/FindPackagesById()?semVerLevel=2.0.0&id='System.Slices'' finished with: []
	-  Request 'https://www.nuget.org/api/v2/Packages?semVerLevel=2.0.0&$filter=Id eq 'System.Slices'' was cancelled (another one was faster)

Is there something I'm doing wrong?

Packet: Restore is failing after installing Ionide plugins

I have installed brand new VS + FSharp + VSCode on Windows 10 Enterprise box. Then I have installed the following plugins: Ionide-fsharp and Ionide-Paket

Whenever I try to execute "Packet: Restore" command (tried in admin mode as well) I get the following Error:
...vscode\extensions\Ionide.ionide-paket-1.9.1\bin\paket.exe
Paket version 3.33.4
Paket failed with:
Error during parsing of ..\paket.lock.
Message: Unknown package settings restriction: && (< net40) (< portable-net45+win8+wp8+wpa81)

Slow to launch paket

Not sure where this issue belongs, however, in recent (post May) iterations of VSCode and Ionide, the initial launch of paket commands seems very slow - approximately 10 seconds before the Paket output console is displayed from cold.
Are there settings I can enable to try to determine where the slowdown is?
(I'm seeing this on all my Windows 10 machines)

Paket should be found if it is in the Path

I'm getting this error:

Neither Paket nor its bootstrapper were found. It is suggested that you download the Paket bootstrapper and save it as .paket/paket.exe

But paket is in my Path, installed by Chocolatey to C:\ProgramData\Chocolatey\bin.

Extension path should be case-sensitive for unix systems

Running extension commands fails on Unix, because in my case VSCode uses path /home/janno/.vscode/extensions/Ionide.ionide-paket when the extension is actually located at /home/janno/.vscode/extensions/Ionide.Ionide-Paket.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.