Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove "key.offset" and "key.length" from results of dictWithCommentMarkNamesCursorInfo() #219

Merged
merged 1 commit into from
Jun 10, 2016

Conversation

norio-nomura
Copy link
Collaborator

Their values are same with key.nameoffset and key.namelength in most case.
When kind is extension, their values locate the type's declaration in their declared file.
That may be different from the file declaring extension.

So, using them is wrong.
Is this related to realm/jazzy#454?

…MarkNamesCursorInfo()`

Their values are same with "key.nameoffset" and "key.namelength" in most case.
When kind is extension, their values locate **the type's declaration** in their declared file.
That may be different from the file declaring extension.

So, using them is wrong.
Is this related to realm/jazzy#454?
@@ -978,11 +978,11 @@
},
{
"key.kind" : "source.lang.swift.decl.extension",
"key.offset" : 326,
"key.offset" : 1603,
Copy link
Collaborator Author

@norio-nomura norio-nomura Jun 10, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an example that the offset and length (326,14) locates in different fie when kind is extension.
The value was offset of NSCharacterSet in NSCharacterSet.h:
screenshot 2016-06-10 19 18 12

@jpsim
Copy link
Owner

jpsim commented Jun 10, 2016

I think this patch does the right thing, and when running jazzy's integration specs, it now picks up type aliases that it was previously dropping:

diff --git a/document_realm_swift/after/docs/Structs/SortDescriptor.html b/document_realm_swift/after/docs/Structs/SortDescriptor.html
index 4b95b91..f332936 100644
--- a/document_realm_swift/after/docs/Structs/SortDescriptor.html
+++ b/document_realm_swift/after/docs/Structs/SortDescriptor.html
@@ -438,7 +438,7 @@ engine.</p>
                     <section class="section">
                       <div class="pointer"></div>
                       <div class="abstract">
-                        <p>Creates a <code><a href="../Structs/SortDescriptor.html">SortDescriptor</a></code> from a <code>UnicodeScalarLiteralType</code>.</p>
+                        <p>Creates a <code><a href="../Structs/SortDescriptor.html">SortDescriptor</a></code> from a <code><a href="../Structs/SortDescriptor.html#/s:V10RealmSwift14SortDescriptor24UnicodeScalarLiteralType">UnicodeScalarLiteralType</a></code>.</p>

                       </div>
                       <div class="declaration">
@@ -478,6 +478,66 @@ engine.</p>
                 <li class="item">
                   <div>
                     <code>
+                    <a name="/s:V10RealmSwift14SortDescriptor24UnicodeScalarLiteralType"></a>
+                    <a name="//apple_ref/swift/Alias/UnicodeScalarLiteralType" class="dashAnchor"></a>
+                    <a class="token" href="#/s:V10RealmSwift14SortDescriptor24UnicodeScalarLiteralType">UnicodeScalarLiteralType</a>
+                    </code>
+                  </div>
+                  <div class="height-container">
+                    <div class="pointer-container"></div>
+                    <section class="section">
+                      <div class="pointer"></div>
+                      <div class="abstract">
+                        <p><code>StringLiteralType</code>. Required for <code>StringLiteralConvertible</code> conformance.</p>
+
+                      </div>
+                      <div class="declaration">
+                        <h4>Declaration</h4>
+                        <div class="language">
+                          <p class="aside-title">Swift</p>
+                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">UnicodeScalarLiteralType</span> <span class="o">=</span> <span class="kt">StringLiteralType</span></code></pre>
+
+                        </div>
+                      </div>
+                      <div class="slightly-smaller">
+                        <a href="https://github.com/realm/realm-cocoa/tree/v1.0.0/RealmSwift-swift2.2/SortDescriptor.swift#L90">Show on GitHub</a>
+                      </div>
+                    </section>
+                  </div>
+                </li>
+                <li class="item">
+                  <div>
+                    <code>
+                    <a name="/s:V10RealmSwift14SortDescriptor34ExtendedGraphemeClusterLiteralType"></a>
+                    <a name="//apple_ref/swift/Alias/ExtendedGraphemeClusterLiteralType" class="dashAnchor"></a>
+                    <a class="token" href="#/s:V10RealmSwift14SortDescriptor34ExtendedGraphemeClusterLiteralType">ExtendedGraphemeClusterLiteralType</a>
+                    </code>
+                  </div>
+                  <div class="height-container">
+                    <div class="pointer-container"></div>
+                    <section class="section">
+                      <div class="pointer"></div>
+                      <div class="abstract">
+                        <p><code>StringLiteralType</code>. Required for <code>StringLiteralConvertible</code> conformance.</p>
+
+                      </div>
+                      <div class="declaration">
+                        <h4>Declaration</h4>
+                        <div class="language">
+                          <p class="aside-title">Swift</p>
+                          <pre class="highlight"><code><span class="kd">public</span> <span class="kd">typealias</span> <span class="kt">ExtendedGraphemeClusterLiteralType</span> <span class="o">=</span> <span class="kt">StringLiteralType</span></code></pre>
+
+                        </div>
+                      </div>
+                      <div class="slightly-smaller">
+                        <a href="https://github.com/realm/realm-cocoa/tree/v1.0.0/RealmSwift-swift2.2/SortDescriptor.swift#L93">Show on GitHub</a>
+                      </div>
+                    </section>
+                  </div>
+                </li>
+                <li class="item">
+                  <div>
+                    <code>
                     <a name="/s:FV10RealmSwift14SortDescriptorcFT30extendedGraphemeClusterLiteralSS_S0_"></a>
                     <a name="//apple_ref/swift/Method/init(extendedGraphemeClusterLiteral:)" class="dashAnchor"></a>
                     <a class="token" href="#/s:FV10RealmSwift14SortDescriptorcFT30extendedGraphemeClusterLiteralSS_S0_">init(extendedGraphemeClusterLiteral:)</a>
@@ -488,7 +548,7 @@ engine.</p>
                     <section class="section">
                       <div class="pointer"></div>
                       <div class="abstract">
-                        <p>Creates a <code><a href="../Structs/SortDescriptor.html">SortDescriptor</a></code> from an <code>ExtendedGraphemeClusterLiteralType</code>.</p>
+                        <p>Creates a <code><a href="../Structs/SortDescriptor.html">SortDescriptor</a></code> from an <code><a href="../Structs/SortDescriptor.html#/s:V10RealmSwift14SortDescriptor34ExtendedGraphemeClusterLiteralType">ExtendedGraphemeClusterLiteralType</a></code>.</p>

                       </div>
                       <div class="declaration">

@jpsim
Copy link
Owner

jpsim commented Jun 10, 2016

I don't think this is related to realm/jazzy#454

@jpsim jpsim merged commit 295b1a3 into master Jun 10, 2016
@jpsim jpsim deleted the nn-fix-offset-and-length-on-doc-command branch June 10, 2016 18:10
@jpsim
Copy link
Owner

jpsim commented Jun 10, 2016

Thanks @norio-nomura!

@norio-nomura
Copy link
Collaborator Author

I don't think this is related to realm/jazzy#454

Sorry, I have not yet read jazzy's codes.
Thanks for merging! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants