djungelorm / sphinx-csharp Goto Github PK
View Code? Open in Web Editor NEWC# domain for Sphinx
License: MIT License
C# domain for Sphinx
License: MIT License
Hello,
sphinx-csharp/sphinx_csharp/csharp.py
Line 510 in b57cb3d
This function raise an exception on Python 3, which cause Sphinx to stop doc generation.
Exception occurred: File "/usr/local/lib/python3.5/dist-packages/sphinx_csharp/csharp.py", line 500, in clear_doc for (typ, name), doc in self.data['objects'].items(): RuntimeError: dictionary changed size during iteration
This issue occurs because, on Python 3, dict.items()
returns an iterator on the dictionary whereas it returns a copy on Python 2.
A fix would be to iterate on an explicit copy of the dictionary gotten with dict(self.data['objects'])
for example.
Best regards,
Currently running into the following error when building documentation:
Exception occurred: File "Documentation\src\.venv\lib\site-packages\sphinx_csharp\csharp.py", line 237, in parse_type_signature match = CLASS_SIG_RE.match(sig.strip()) AttributeError: 'NoneType' object has no attribute 'strip'
I was able to come up with a work around by changing
def parse_type_signature(sig: str, location):
""" Parse a type declaration or usage signature """
match = CLASS_SIG_RE.match(sig.strip())
if not match:
logger.warning(f'Type signature invalid: {sig}', location=location)
return sig, None, None, None, None
to be
def parse_type_signature(sig: str, location):
""" Parse a type declaration or usage signature """
match = False
if sig is not None:
match = CLASS_SIG_RE.match(sig.strip())
if not match:
logger.warning(f'Type signature invalid: {sig}', location=location)
return sig, None, None, None, None
Our script is setting up a python virtual environment, so we added a step to replace csharp.py in the venv with a custom file that has the changes.
We wanted to reach out and see if there might be something we're doing wrong on our end. But if this is an actual bug we also want to help out by letting you know.
Let us know if you need anymore details. Thanks!
is it possible to use the automodule function on csharp projects after importing 'sphinx_csharp.csharp'?
if it is possible, What is the correct comment format for sphinx csharp?
I get the following error when adding the sphinx_csharp extension
Exception occurred:
File "/usr/local/lib/python3.9/site-packages/breathe/renderer/sphinxrenderer.py", line 185, in <module>
class CSharpNamespacePlain(BaseObject, cs.CSharpNamespacePlain):
AttributeError: module 'sphinx_csharp.csharp' has no attribute 'CSharpNamespacePlain'
The full traceback has been saved in /var/folders/gj/_wrr7xy53f5bkr53zt2zp4qw0000gp/T/sphinx-err-gl7u19db.log, if you want to report the issue to the developers.
The following sphinx code:
.. method:: IApplicationBuilder UseVonkInteraction<TService>(this IApplicationBuilder app, Expression<Action<<TService, IVonkContext>> handler, OperationType operationType = OperationType.Handler)
Doesn't work, unfortunately:
Exception occurred:
File "/home/vadi/.local/lib/python2.7/site-packages/sphinx_csharp/csharp.py", line 114, in parse_param_signature
raise RuntimeError('Parameter signature invalid, got ' + sig)
RuntimeError: Parameter signature invalid, got this IApplicationBuilder app
# Last messages:
# 283 added, 0 changed, 0 removed
#
# reading sources... [ 0%] changelog
#
# reading sources... [ 0%] cs/core.article/article
#
# reading sources... [ 1%] cs/core.article/article.enums
#
# reading sources... [ 1%] cs/core.article/article.messages
#
# Loaded extensions:
# alabaster (0.7.10) from /usr/local/lib/python3.6/site-packages/alabaster/__init__.py
# sphinx.ext.intersphinx (1.7.2) from /usr/local/lib/python3.6/site-packages/sphinx/ext/intersphinx.py
# sphinx.ext.coverage (1.7.2) from /usr/local/lib/python3.6/site-packages/sphinx/ext/coverage.py
# sphinx.ext.ifconfig (1.7.2) from /usr/local/lib/python3.6/site-packages/sphinx/ext/ifconfig.py
# sphinx_csharp.csharp (unknown version) from /usr/local/lib/python3.6/site-packages/sphinx_csharp/csharp.py
# sphinxcontrib.httpdomain (unknown version) from /usr/local/lib/python3.6/site-packages/sphinxcontrib/httpdomain.py
# sphinx.ext.mathjax (1.7.2) from /usr/local/lib/python3.6/site-packages/sphinx/ext/mathjax.py
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/sphinx/cmdline.py", line 304, in main
app.build(args.force_all, filenames)
File "/usr/local/lib/python3.6/site-packages/sphinx/application.py", line 331, in build
self.builder.build_update()
File "/usr/local/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 338, in build_update
'out of date' % len(to_build))
File "/usr/local/lib/python3.6/site-packages/sphinx/builders/__init__.py", line 351, in build
updated_docnames = set(self.env.update(self.config, self.srcdir, self.doctreedir))
File "/usr/local/lib/python3.6/site-packages/sphinx/environment/__init__.py", line 565, in update
self._read_serial(docnames, self.app)
File "/usr/local/lib/python3.6/site-packages/sphinx/environment/__init__.py", line 584, in _read_serial
self.read_doc(docname, app)
File "/usr/local/lib/python3.6/site-packages/sphinx/environment/__init__.py", line 659, in read_doc
doctree = read_doc(self.app, self, self.doc2path(docname))
File "/usr/local/lib/python3.6/site-packages/sphinx/io.py", line 294, in read_doc
pub.publish()
File "/usr/local/lib/python3.6/site-packages/docutils/core.py", line 217, in publish
self.settings)
File "/usr/local/lib/python3.6/site-packages/docutils/readers/__init__.py", line 72, in read
self.parse()
File "/usr/local/lib/python3.6/site-packages/docutils/readers/__init__.py", line 78, in parse
self.parser.parse(self.input, document)
File "/usr/local/lib/python3.6/site-packages/sphinx/parsers.py", line 85, in parse
self.statemachine.run(inputstring, document, inliner=self.inliner)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 171, in run
input_source=document['source'])
File "/usr/local/lib/python3.6/site-packages/docutils/statemachine.py", line 239, in run
context, state, transitions)
File "/usr/local/lib/python3.6/site-packages/docutils/statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 2988, in text
self.section(title.lstrip(), source, style, lineno + 1, messages)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 327, in section
self.new_subsection(title, lineno, messages)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 395, in new_subsection
node=section_node, match_titles=True)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
node=node, match_titles=match_titles)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 196, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/usr/local/lib/python3.6/site-packages/docutils/statemachine.py", line 239, in run
context, state, transitions)
File "/usr/local/lib/python3.6/site-packages/docutils/statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 2326, in explicit_markup
nodelist, blank_finish = self.explicit_construct(match)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 2338, in explicit_construct
return method(self, expmatch)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 2081, in directive
directive_class, match, type_name, option_presets)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 2130, in run_directive
result = directive_instance.run()
File "/usr/local/lib/python3.6/site-packages/sphinx/domains/__init__.py", line 237, in run
return BaseDirective.run(self)
File "/usr/local/lib/python3.6/site-packages/sphinx/directives/__init__.py", line 179, in run
self.state.nested_parse(self.content, self.content_offset, contentnode)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
node=node, match_titles=match_titles)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 196, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/usr/local/lib/python3.6/site-packages/docutils/statemachine.py", line 239, in run
context, state, transitions)
File "/usr/local/lib/python3.6/site-packages/docutils/statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 2326, in explicit_markup
nodelist, blank_finish = self.explicit_construct(match)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 2338, in explicit_construct
return method(self, expmatch)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 2081, in directive
directive_class, match, type_name, option_presets)
File "/usr/local/lib/python3.6/site-packages/docutils/parsers/rst/states.py", line 2130, in run_directive
result = directive_instance.run()
File "/usr/local/lib/python3.6/site-packages/sphinx/domains/__init__.py", line 237, in run
return BaseDirective.run(self)
File "/usr/local/lib/python3.6/site-packages/sphinx/directives/__init__.py", line 160, in run
name = self.handle_signature(sig, signode)
File "/usr/local/lib/python3.6/site-packages/sphinx_csharp/csharp.py", line 448, in handle_signature
name, params = parse_attr_signature(sig)
File "/usr/local/lib/python3.6/site-packages/sphinx_csharp/csharp.py", line 142, in parse_attr_signature
raise RuntimeError('Attribute signature invalid, got ' + sig)
RuntimeError: Attribute signature invalid, got string Uuid
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.