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 #32 from takkii/develop
Browse files Browse the repository at this point in the history
Update.
  • Loading branch information
takkii authored Jun 1, 2023
2 parents 4239974 + c149d10 commit fe6bed3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions rplugin/python3/deoplete/sources/phantom.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ def __init__(self, vim):
self.filetypes = ['php']
mark_synbol: Optional[str] = '[PHP-complete]'
self.mark = str(mark_synbol)
ruby_match = [r'\.[a-zA-Z0-9_?!]*|[a-zA-Z]\w*::\w*']
php_match = [r'\.[a-zA-Z0-9_?!]*|[a-zA-Z]\w*::\w*']
slash_no_match = [r'[;/[^¥/]\*/]']
self.input_pattern = '|'.join(ruby_match + slash_no_match)
self.input_pattern = '|'.join(php_match + slash_no_match)
self.rank = 500

def get_complete_position(self, context):
ruby_complete: Optional[str] = '[a-zA-Z0-9_?!]*$'
m = re.search(ruby_complete, context['input'])
php_complete: Optional[str] = '[a-zA-Z0-9_?!]*$'
m = re.search(php_complete, context['input'])
return m.start() if m else -1

def gather_candidates(self, context):
Expand All @@ -42,11 +42,11 @@ def gather_candidates(self, context):
with open(os.path.expanduser(config_load)) as yml:
config = yaml.safe_load(yml)

# Get Receiver/Ruby Method Complete.
# Get Receiver/php 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
data_php: Optional[list] = [s.rstrip() for s in data]
complete: Optional[list] = data_php
complete.sort(key=itemgetter(0))
return complete

Expand All @@ -55,11 +55,11 @@ def gather_candidates(self, context):
with open(os.path.expanduser(plug_config)) as yml:
config = yaml.safe_load(yml)

# Get Receiver/Ruby Method Complete.
# Get Receiver/php 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
plug_php: Optional[list] = [s.rstrip() for s in data]
r_complete: Optional[list] = plug_php
r_complete.sort(key=itemgetter(0))
return r_complete

Expand Down

0 comments on commit fe6bed3

Please sign in to comment.