Giter VIP home page Giter VIP logo

Comments (3)

mhanberg avatar mhanberg commented on May 25, 2024

Closed by https://github.com/elixir-tools/next-ls/releases/tag/v0.5.0

Followup tasks created #85 #86 #87 #88 #89 #90 #91

from next-ls.

josevalim avatar josevalim commented on May 25, 2024

Hi @mhanberg, quick question: you are using the compilation tracer to collect information about aliases, function calls, etc. This requires, however, the current module to be compiled for you to enable this functionality. Has this been a problem? Or are you frequently compiling the code behind the scenes instead of relying on the Mix compiler exclusively?

from next-ls.

mhanberg avatar mhanberg commented on May 25, 2024

hi @josevalim!

Next LS does require a full compilation for go to def/references/workspace symbols to become fully populated (meaning, if you are starting it for the first time, or a migration is run on the sqlite database), but i haven't noticed this to be a problem. (if i do notice a problem, there is usually one or more other things going wrong, so most likely not a tracer related thing)

and yes, it utilizes the mix compiler exclusively. this is the code it uses when executing the compiler

defmodule :_next_ls_private_compiler do
  @moduledoc false

  @tracers Code.get_compiler_option(:tracers)

  def compile do
    # keep stdout on this node
    Process.group_leader(self(), Process.whereis(:user))
    Code.put_compiler_option(:parser_options, columns: true, token_metadata: true)

    Code.put_compiler_option(:tracers, [NextLSPrivate.DepTracer | @tracers])

    Mix.Task.clear()

    # load the paths for deps and compile them
    # will noop if they are already compiled
    # The mix cli basically runs this before any mix task
    # we have to rerun because we already ran a mix task
    # (mix run), which called this, but we also passed
    # --no-compile, so nothing was compiled, but the
    # task was not re-enabled it seems
    Mix.Task.rerun("deps.loadpaths")

    Code.put_compiler_option(:tracers, [NextLSPrivate.Tracer | @tracers])

    Mix.Task.rerun("compile", [
      "--ignore-module-conflict",
      "--no-protocol-consolidation",
      "--return-errors"
    ])
  rescue
    e -> {:error, e}
  end
end

from next-ls.

Related Issues (20)

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.