Skip to content

Extra modules path doesn't work for single files.  #259

Closed

Description

@rabidlogic

Steps to Reproduce

  1. Configure extra module paths (I've been using Blender modules - /usr/share/blender/2.78/scripts/modules)
  2. Open a single file (no project loaded)
  3. Trigger autocompletion for the external modules

Expected behavior: The external modules should be present in the list.

Actual behavior: Nope. The extraPaths are actually blanked out, so the config value is not used.

The issue is in interpreters-lookup.coffee. The modPaths array is only populated if projects are present.

Currently

  applySubstitutions: (paths) ->
    modPaths = []
    log.debug 'paths', paths
    for p in paths
      for project in atom.project.getPaths()
        [..., projectName] = project.split(path.sep)
        p = p.replace(/\$PROJECT_NAME/i, projectName)
        p = p.replace(/\$PROJECT/i, project)
        log.debug 'sub path', p
        if p not in modPaths
          modPaths.push p
    return modPaths

Better

  applySubstitutions: (paths) ->
    modPaths = []
    log.debug 'paths', paths
    for p in paths
      for project in atom.project.getPaths()
        [..., projectName] = project.split(path.sep)
        p = p.replace(/\$PROJECT_NAME/i, projectName)
        p = p.replace(/\$PROJECT/i, project)
        log.debug 'sub path', p
      if p not in modPaths
        modPaths.push p
    return modPaths

Activity

  1. self-assigned this
    on Dec 18, 2016
  2. added a commit that references this issue on Sep 21, 2017
    a750db1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions