Page MenuHomePhabricator

Truncate long source lines in Paste search result list snippets

Authored by gd on Oct 20 2015, 4:30 PM.



An attempt to resolve T9600.

  • PhabricatorPasteQuery builds truncated snippet when requested using needSnippet().
  • PhabricatorPasteSearchEngine uses Paste snippet istead of content.
  • PhabricatorSourceCodeView accepts truncated source and type instead of line limit.
Test Plan

Generated some content for Paste application and also added huge JSON oneliner. Checked Paste application pages in browser.

Diff Detail

rP Phabricator
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

gd retitled this revision from to Truncate long source lines in Paste search result list snippets.
gd updated this object.
gd edited the test plan for this revision. (Show Details)
gd added a reviewer: epriestley.
epriestley edited edge metadata.

Seems reasonable as a step forward to me, thanks! A couple minor inlines. You should have commit access now.


For consistency, prefer needSnippets() over needSnippet() (i.e., plural) -- Query classes load multiple objects in the general case.


Prefer phutil_json_decode().


Prefer phutil_json_encode().

This revision is now accepted and ready to land.Oct 20 2015, 4:38 PM
This revision was automatically updated to reflect the committed changes.
gd marked 3 inline comments as done.