Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #30 from takkii/develop
Browse files Browse the repository at this point in the history
Update.
  • Loading branch information
takkii authored May 23, 2023
2 parents ad0b3ff + 5fc0875 commit cb13246
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions rplugin/python3/deoplete/sources/phantom.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,28 +29,43 @@ def get_complete_position(self, context):

def gather_candidates(self, context):
try:
# Settings config/folder/file Loading PATH.
# Settings, Config path is true/false change.
config_load: Optional[str] = '~/config/load.yml'
folder_load: Optional[str] = 'Home_Folder'
plug_config: Optional[str] = '~/.neovim/plugged/config/load.yml'

# Settings, Loading File PATH.
file_load: Optional[str] = 'Home_File'
plug_load: Optional[str] = 'File_Load'

# Set the dictionary.
with open(os.path.expanduser(config_load)) as yml:
config = yaml.safe_load(yml)
yml_load = os.path.expanduser(config[folder_load])
# Home Folder, Set the dictionary.
if os.path.isfile(os.path.expanduser(config_load)):
with open(os.path.expanduser(config_load)) as yml:
config = yaml.safe_load(yml)

# Get Receiver/Ruby Method Complete.
if os.path.isdir(yml_load):
# Get Receiver/Ruby Method Complete.
with open(os.path.expanduser(config[file_load])) as r_method:
data = list(r_method.readlines())
data_ruby: Optional[list] = [s.rstrip() for s in data]
complete: Optional[list] = data_ruby
complete.sort(key=itemgetter(0))
return complete

# Use vim-plug, Set the dictionary.
elif os.path.isfile(os.path.expanduser(plug_config)):
with open(os.path.expanduser(plug_config)) as yml:
config = yaml.safe_load(yml)

# Get Receiver/Ruby Method Complete.
with open(os.path.expanduser(config[plug_load])) as r_method:
data = list(r_method.readlines())
plug_ruby: Optional[list] = [s.rstrip() for s in data]
r_complete: Optional[list] = plug_ruby
r_complete.sort(key=itemgetter(0))
return r_complete

# Config Folder not found.
else:
raise ValueError("None, Please Check the Config Folder.")
raise ValueError("None, Please Check the Config Folder")

# TraceBack.
except Exception:
Expand Down

0 comments on commit cb13246

Please sign in to comment.