Skip to content

Limit augment to workspaces #28

@Waino

Description

@Waino

Expected behavior

I expected augment.vim to be active only in the workspaces set in g:augment_workspace_folders.

Actual behavior

I was surprised (and not pleasantly) to find that augment.vim was autocompleting in all files opened anywhere, not just limited to the paths I set in g:augment_workspace_folders.

Motivation

For an IDE like vs code, it is reasonable to assume that the software will only be used for programming, and you want autocompletion everywhere. An editor like nvim on the other hand is used for all kinds of files, only some of which relate to the programming projects. This can include sensitive files that the user clearly would not want to send to an API.

Proposed solution

Make the current behavior (autocomplete everywhere) require explicit opt-in by setting a variable, e.g. g:augment_enabled_outside_workspace = v:true. If not set, or set to false, default to only enabling the autocompletion inside the workspaces.

Workaround

Luckily I noticed this before opening any truly sensitive file, and put in place a workaround that requires an env variable USE_AUGMENT to be set before the plugin is loaded. This allows enabling augment per shell session.

call plug#begin('~/.config/.nvim/plugged')
" Augment code completion (conditional on env var)
if !empty($USE_AUGMENT)
    Plug 'augmentcode/augment.vim'
endif
call plug#end()

Metadata

Metadata

Assignees

No one assigned

    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