-
Notifications
You must be signed in to change notification settings - Fork 133
No completions for python-docx #178
Comments
I want to work on this, please help, beginner here |
Test to repro the issue: [TestMethod, Priority(0)]
public async Task PythonDocxCompletion() {
var text = @"import docx
doc = docx.Document()
doc.";
using (var server = await new Server().InitializeAsync(PythonVersions.LatestAvailable)) {
var uri = await server.OpenDefaultDocumentAndGetUriAsync(text);
var completion = await server.SendCompletion(uri, 3, 4);
completion.Should().HaveItem("settings");
}
} |
@supriyanta - this may not be an easy thing :-). basically you want to
You can start with completion repro and see what types are attached to |
Seems hard for me :( |
Okay, thanks for your help! |
Where is this file located? |
Although while debugging I found few issues related to property resolution, this is, unfortunately, by design. Jedi does not show anything either. The reason is that there is no type. Document: def Document(docx=None):
document_part = Package.open('s').main_document_part
return document_part.document OpcPackage: @property
def main_document_part(self):
return self.part_related_by(RT.OFFICE_DOCUMENT)
@classmethod
def open(cls, pkg_file):
package = cls()
return package
def part_related_by(self, reltype):
return self.rels.part_with_reltype(reltype)
@lazyproperty
def rels(self):
return Relationships(PACKAGE_URI.baseURI) Relationships: class Relationships(dict):
def _get_rel_of_type(self, reltype):
matching = [rel for rel in self.values() if rel.reltype == reltype]
...
return matching[0] but since it is based on plain |
Actually, we may try and add type based on |
From microsoft/PTVS#4752
The text was updated successfully, but these errors were encountered: