Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop changes #419

Closed
wants to merge 15 commits into from
Closed

Develop changes #419

wants to merge 15 commits into from

Conversation

GTrunSec
Copy link
Collaborator

  • add kernels info into passthru

@netlify
Copy link

netlify bot commented Jan 24, 2023

Deploy Preview for tweag-jupyterwith ready!

Name Link
🔨 Latest commit 3512564
🔍 Latest deploy log https://app.netlify.com/sites/tweag-jupyterwith/deploys/63e06d8e28ae91000912c9bc
😎 Deploy Preview https://deploy-preview-419--tweag-jupyterwith.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@GTrunSec GTrunSec marked this pull request as draft January 24, 2023 16:54
@GTrunSec GTrunSec marked this pull request as ready for review January 24, 2023 17:36
@djacu
Copy link
Contributor

djacu commented Jan 26, 2023

Hey @GTrunSec

Thanks for the PR! I like the simplification you made with the start up file.

A couple curious questions and one comment about an upcoming PR.

  • We are merging New UI (nixos modules based) #376 next week and it is going to change a lot of code. Could you rebase off that PR and make the necessary updates. I'm also happy to do it if you would like.
  • Is there some difference between julia and julia-bin? No problem switching. Just don't know.
  • What are you using the passthru for?

@GTrunSec
Copy link
Collaborator Author

GTrunSec commented Jan 26, 2023

Is there some difference between julia and julia-bin? No problem switching. Just don't know.

The difference is that binary source or building julia from the source with(nixpkgs prefer).

What are you using the passthru for?

It is convenient and important for us to reproduce the path(~/.local/jupyter/kernels*) of the kernels in the overall environment. You know most tools are based on that two values for getting kernel info.(jupyter kernelspec list --json or from $HOME/.local/jupyter kernels directly).

make sure we can import nixpkgs directrly
example = {
  nixpkgs = import inputs.nixpkgs.path {
    config = {};
    system = "x86_64-linux"
  };
 # or
 nixpkgs = inputs.nixpks;
}
@GTrunSec
Copy link
Collaborator Author

GTrunSec commented Feb 2, 2023

Fixes: #402
you can enable this feature with the module setting of config.jupyterlab.features = ["lsp"], more than one features like ["lsp" "jupytext"]
notebooks (auto-K) - JupyterLab 2023-02-02 11-02-44

it allows us to link the kernelPaths, for solving some tools getting the
kernelInfo only from ~/.local/jupyter/kernles or another place
@GTrunSec
Copy link
Collaborator Author

GTrunSec commented Feb 3, 2023

Oh, we got Julia-LSP working as well.
julia ipynb (2) - JupyterLab 2023-02-02 17-52-22

allows to spcific a languageServer package
@GTrunSec
Copy link
Collaborator Author

GTrunSec commented Feb 3, 2023

now, we can use the following code to specify a languageServer package or env.

    config = {
      jupyterlab = {
        extensions = {
          features = ["lsp" "jupytext"];
          languageServers = {
            python = ps: ps.python-lsp-server;
          };
        };
        jupyterlabEnvArgs.extraPackages = ps: ([] ++ ps.python-lsp-server.passthru.optional-dependencies.all);
      };
}

@GTrunSec GTrunSec mentioned this pull request Feb 3, 2023
@GTrunSec
Copy link
Collaborator Author

GTrunSec commented Feb 3, 2023

@jamesdbrock I had a problem with haskell-language-server when I was trying to setup the lsp support.
The output was:

             , ghcide-type-lenses
             , ghcide-code-actions-imports-exports
             , ghcide-hover-and-symbols
             , eval
             , gadt
             , fourmolu
             , callHierarchy
             , stylish-haskell
             , ghcide-code-actions-type-signatures
             , ghcide-code-actions-bindings
             , moduleName
             , ormolu
             , ghcide-core
             , explicit-fixity ]
2023-02-03T18:22:53.958582Z | Info | Starting server
2023-02-03T18:22:53.965274Z | Info | Started LSP server in 0.01s
2023-02-03T18:22:54.008607Z | Info | Registering IDE configuration: IdeConfiguration {workspaceFolders = fromList [NormalizedUri (-7920826821002028544) "file:///home/guangtao/ghq/github.com/GTrunSec/DeSci/.virtual_documents"], clientSettings = hashed Nothing}
2023-02-03T18:22:54.485661Z | Warning | No plugin enabled for STextDocumentDidOpen
2023-02-03T18:22:54.490097Z | Warning | No plugin enabled for STextDocumentDidChange
2023-02-03T18:22:54.498037Z | Warning | No plugin enabled for STextDocumentDidChange
2023-02-03T18:22:54.502784Z | Warning | No plugin enabled for STextDocumentDidChange

So, do I need some specifically setting for hls? that would be enabled the completion and code highlight?

          languageServers = {
            python = ps: ps.python-lsp-server;
            haskell = nixpkgs.haskellPackages.ghcWithPackages (ghcPkgs:
              with ghcPkgs; [
                haskell-language-server
                hlint
                ghcide
              ]);
          };

thanks

@jamesdbrock
Copy link
Contributor

@jamesdbrock I had a problem with haskell-language-server when I was trying to setup the lsp support. So, do I need some specifically setting for hls? that would be enabled the completion and code highlight?

Hi @GTrunSec , nice to hear from you. I love what you're trying to do here. Maybe you're asking my advice because I tried to get jupyter-lsp working with IHaskell once? jupyter-lsp/jupyterlab-lsp#313 I don't have any advice for you here, sorry. But you have my moral support! ❤️

@GTrunSec
Copy link
Collaborator Author

GTrunSec commented Feb 4, 2023

@jamesdbrock thanks for your response. I should open an issue on the upstream.

@djacu
Copy link
Contributor

djacu commented Feb 6, 2023

Hey @GTrunSec

Really awesome work here! Thanks for putting in all this effort.

I hate to ask but could you split this PR up? It looks like 3 or 4 PRs:

  • passthru
  • julia-bin -> julia
  • legacyPackages -> nixpkgs via module types
  • LSP

I was working primarily on https://github.com/nickel-lang/nickel-nix/ last week so I wasn't able to review anything
But I am back 50% on jupyenv so I can review things a lot quicker going forward.

@GTrunSec
Copy link
Collaborator Author

GTrunSec commented Feb 14, 2023

@thomasjm I see that you have been successfully running hls in codedownio(awesome project). Maybe you could give me some ideas for my current problem with haskell-language-server in jupyterlab-lsp. By the way, if you don't mind, I can attempt codedownio-desktop as an extra option to replace jupyterlab.
thanks

@thomasjm
Copy link

Hi @GTrunSec -- running HLS against Haskell notebooks is quite tricky, because IHaskell accepts top-level statements and stuff that HLS won't parse. I have a solution in progress but it's not quite ready to publish yet. I'm not familiar with jupyterlab-lsp but it looks a bit like a problem where you're trying to use a .ipynb extension and HLS doesn't like it because it only knows about .hs.

As soon as CodeDown Desktop is ready as a Jupyterlab alternative I'll let you know :)

@GTrunSec
Copy link
Collaborator Author

@thomasjm thanks, I see.

As soon as CodeDown Desktop is ready as a Jupyterlab alternative I'll let you know :)

Nice, looking forward to it. I also have an excellent MLOps solution for that.

@GTrunSec GTrunSec closed this Feb 17, 2023
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.

4 participants