forked from ycm-core/ycmd
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Ability to ignore extra conf files
- Loading branch information
1 parent
c86b061
commit 7e20d1e
Showing
4 changed files
with
77 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Copyright (C) 2011-2019 ycmd contributors | ||
# | ||
# This file is part of ycmd. | ||
# | ||
# ycmd is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# ycmd is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with ycmd. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
from __future__ import unicode_literals | ||
from __future__ import print_function | ||
from __future__ import division | ||
from __future__ import absolute_import | ||
# Not installing aliases from python-future; it's unreliable and slow. | ||
from builtins import * # noqa | ||
|
||
|
||
class IgnoreExtraConf( Exception ): | ||
"""Raise this exception from within a FlagsForFile or Settings function to | ||
instruct ycmd to ignore this module for the current file. | ||
For example, if you wish to delegate to ycmd's built-in compilation database | ||
support, you can write: | ||
from ycmd.extra_conf_support import IgnoreExtraConf | ||
def Settings( **kwargs ): | ||
if kwargs[ 'language' ] == 'c-family': | ||
# Use compilation database | ||
raise IgnoreExtraConf() | ||
if kwargs[ 'language' ] == 'python': | ||
... | ||
This will then tell ycmd to use your compile_commands.json, or global extra | ||
conf as if this local module doens't exist. | ||
""" | ||
pass |